Jump to content
Sign in to follow this  
MikeJohansen

Button to make Textbox assign to variable.

Recommended Posts

MikeJohansen

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 ?

Share this post


Link to post
Share on other sites
JohnOne

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.

Share this post


Link to post
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
Sign in to follow this  

×