Sign in to follow this  
Followers 0
ninja

GUICtrlSetOnEvent ControlID = -1

3 posts in this topic

I just made a form with Koda and was reviewing the code. I can not understand one thing. In my form I created an input box. My script is using OnEventMode but I dont understand how the event are being assigned

The Koda Generate code, which seems to work

$txtServer = GUICtrlCreateInput("", 96, 120, 345, 24)

GUICtrlSetOnEvent(-1, "txtServerChange")

the autoit help file indicates the first parameter is a controlID

GUICtrlSetOnEvent ( controlID, "function" )

So what I dont understand is how the (-1) Control Id attached to the correct control?

It seems all the Koda created controls call GUICtrlSetOnEvent with -1

Also it is possible to use multiple event on a single control, for example on a button can I capture the MouseOver Event as well as the Clicked Event?

Can someone explain how this is working or if -1 is a special default value?

Thanks in Advance

Share this post


Link to post
Share on other sites



- Control ID -1 is for last control

- for more events see GUIRegisterMsg()

Zedna

Thanks for the quick reply, that code makes sense now.

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