Jump to content

Button to make Textbox assign to variable.


Go to solution Solved by JohnOne,

Recommended Posts

Hi, i need some help i have a Textbox where you can type in, what i want now is that when i press a button it takes the Text i entered and assign it to a variable.

So far i only have the Textbox & Button, i have been trying different things but no luck :(

Func SetInterval()

Local $msg

$gui = GUICreate("Test GUI", 640, 280)
Global $input = GUICtrlCreateInput("Input field", 10, 10, 620, 20)
;$edit = GUICtrlCreateEdit("Edit Control with Text", 10, 40, 620, 200)
$button = GUICtrlCreateButton("Button", 10, 250, 620, 20)

GUISetState(@SW_SHOW, $gui)

While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $gui
                ExitLoop

        EndSwitch
    WEnd
   GUIDelete($gui)
EndFunc

Any thoughts ?

Link to comment
Share on other sites

  • Solution

SetInterval()

Func SetInterval()



    Local $msg



    $gui = GUICreate("Test GUI", 640, 280)

    Global $input = GUICtrlCreateInput("Input field", 10, 10, 620, 20)

    ;$edit = GUICtrlCreateEdit("Edit Control with Text", 10, 40, 620, 200)

    $button = GUICtrlCreateButton("Button", 10, 250, 620, 20)



    GUISetState(@SW_SHOW, $gui)



    While 1

        Switch GUIGetMsg()

            Case -3; $GUI_EVENT_CLOSE

                ExitLoop

            Case $button
                $msg = GUICtrlRead($input)
                MsgBox(0, 0, $msg)

        EndSwitch

    WEnd

    GUIDelete($gui)

EndFunc   ;==>SetInterval

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...