stuartc1 Posted May 19, 2005 Share Posted May 19, 2005 Hi all, just found out about autoit a couple of days ago and think it's great I've been writing a script and ran into a problem... here is my scenario -> I have a GUI form created with Opt("GUIOnEventMode", 1) as I need to pass variables from text box form fields... I have several text boxes each with their own submit button (each field does a different action). All fine and working.... I've been using: GUICtrlSetOnEvent($submitF, "SubmitFunc") so that when a button is clicked the function SubmitFunc() will run.... works fine. But I dont want to create a new function for every text/submit I have as there will be lots of duplicate code. So what I need to do is pass the value of the text field to the function when the related button is clicked. After looking at the docs for GUICtrlSetOnEvent() I see no way of passing values/variables. Is this possible or is there some other way to do this? hope this make sense many thanks stuartc1 Link to comment Share on other sites More sharing options...
Lazycat Posted May 19, 2005 Share Posted May 19, 2005 Passing variables not supported, but you can use @GUI_CtrlId macro to know what last control was clicked. Func SubmitFunc() MsgBox(0,"Last control ID:", @GUI_CtrlId) Endfunc Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now