Sign in to follow this  
Followers 0
AutoitFaN1000

When a button is pressed

5 posts in this topic

I feel dumb, but what function do i use to tell if a button in a gui is pressed? >_< Thanks.

Share this post


Link to post
Share on other sites



Open your helpfile and read ALL three pages under "GUI Reference". It will teach you how to build basic gui's in two different ways, commonly called after how they work, MessageLoop and OnEvent.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

$button = GUICtrlCreateButton("Click Me", 10, 10, 80, 25)

While 1
    $msg = GUIGetMsg()

    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $button
            msgbox(0,"Status","Yes, you did click on me!")
    EndSelect
WEnd

Edited by DYONISII

http://dev.dyonisii.com/

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

$button = GUICtrlCreateButton("Click Me", 10, 10, 80, 25)

While 1
    $msg = GUIGetMsg()

    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $button
            msgbox(0,"Status","Yes, you did click on me!")
    EndSelect
WEnd

AdmiralAlkex gave the OP the best advice he could get, yet you post a simple button code with missing parts such as the actual GUICreate() and includes. Edited by Info

Share this post


Link to post
Share on other sites

Thanks alex. Also, I'm using koda, so i dont need to make the gui my self, just use it.

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  
Followers 0