Jump to content
Sign in to follow this  
theguy0000

button...

Recommended Posts

theguy0000

how do i call a function when a button is clicked?

thanks!


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites
Valuater

You should explain more.. and if you have code... show us so we can see what you are working with...

every time you post ( i had to ask you this last time too!)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
theguy0000

ok lol

lets say i have a function called myFunction. when someone clicks a button in a GUI i want it to call myFunction.


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites
Valuater

mostly copied from help files

#include <GUIConstants.au3>

GUICreate("My GUI Button"); will create a dialog box that when displayed is centered

Opt("GUICoordMode",2)
$OK = GUICtrlCreateButton ("OK",  10, 30, 50)
$Close = GUICtrlCreateButton ( "Close",  0, -1)

GUISetState ()      ; will display an  dialog box with 2 button

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $OK then Call("ShowMessage")
        
    If $msg = $Close then Call("Terminate")
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend




Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
    MsgBox(4096,"","This is a message from a function.")
EndFunc

check out help files.... at the bottom are small scripts to see what they do

8)

looks just like you said call "myfunction" with parenthacies

Edited by Valuater

NEWHeader1.png

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  

×