Jump to content
Sign in to follow this  
Ham123

Guisetonevent help?

Recommended Posts

Ham123

Why doesn't this script work?

CODE

#include <GUIConstantsEx.au3>

Gui()

func gui()

Opt("GUIOnEventMode", 1)

GUICreate("hello", 500, 500, 500, 500)

guictrlcreatetab(0,0,500,25)

$lolbutton=guictrlcreatebutton("lolbutton", 50, 50, 50, 50)

guisetonevent($GUI_EVENT_CLOSE, "close")

guisetonevent($lolbutton, "lol")

GUISetState(@SW_SHOW)

endfunc

while 1

sleep(10)

wend

func close()

exit

endfunc

func lol()

mouseclick("left", 500, 500, 5)

endfunc

I was trying out a feature for something..and last time i made something similar it worked fine..however now it is not working?

it executes the close function, however, it does not execute the lol function.

Edited by Ham123

Share this post


Link to post
Share on other sites
DarkBoost

From my understanding GUISetOnEvent is for the GUI itself and GUICtrlSetOnEvent is for buttons etc. Change this and see if it works :D

Share this post


Link to post
Share on other sites
Authenticity

It's GUICtrlSetOnEvent() for control events.

Share this post


Link to post
Share on other sites
Ham123

From my understanding GUISetOnEvent is for the GUI itself and GUICtrlSetOnEvent is for buttons etc. Change this and see if it works :D

LOL yup that worked xD thanks to you and Authenticity :D

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.