EndFunc Posted November 3, 2009 Share Posted November 3, 2009 (edited) Ok I have a combobox that is populated by values in an Ini file. I have the drop show all the values that I want. What I want to do is when it is changed to another value to do something else. I know you can probably do Guictrlread but I don't want it constantly reading that ctrl the whole time the app is open. Is there any other way to do this that is efficient? TIA To clarify, I don't want a button to excute the option. I want it done when I select the option. Edited November 3, 2009 by EndFunc EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
martin Posted November 3, 2009 Share Posted November 3, 2009 (edited) Ok I have a combobox that is populated by values in an Ini file. I have the drop show all the values that I want. What I want to do is when it is changed to another value to do something else. I know you can probably do Guictrlread but I don't want it constantly reading that ctrl the whole time the app is open. Is there any other way to do this that is efficient? TIA All you need to do is to respond to the event. If you are not using OnEvent mode then in your message loop have something like $msg = GuiGetMsg() Switch $msg Case $GUI_EVENT_EXIT exit Case $Combo1 ;the selection has been set ; do something, but it might not have been changed EndSwitch If in OnEvent mode just GuiCtrlRegister($combo1,"combosetfunc") EDIT:typo Edited November 3, 2009 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
EndFunc Posted November 3, 2009 Author Share Posted November 3, 2009 All you need to do is to respond to the event. If you are not using OnEvent mode then in your message loop have something like $msg = GuiGetMsg() Switch $msg Case $GUI_EVENT_EXIT exit Case $Combo1 ;the selection has been set ; do something, but it might not have been changed EndSwitch If in OnEvent mode just GuiCtrlRegister($combo1,"combosetfunc") EDIT:typo Sweet, I learn something everyday. I didn't like the constant polling and didn't realize OnEvent was available. I will look at that. Thanks EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
EndFunc Posted November 3, 2009 Author Share Posted November 3, 2009 All you need to do is to respond to the event. If you are not using OnEvent mode then in your message loop have something like $msg = GuiGetMsg() Switch $msg Case $GUI_EVENT_EXIT exit Case $Combo1 ;the selection has been set ; do something, but it might not have been changed EndSwitch If in OnEvent mode just GuiCtrlRegister($combo1,"combosetfunc") EDIT:typo I dont see a command GuiCtrlRegister. Were you talking about GUICtrlSetOnEvent? EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
martin Posted November 4, 2009 Share Posted November 4, 2009 I dont see a command GuiCtrlRegister. Were you talking about GUICtrlSetOnEvent?Yes, I meant GuiCtrlSetOnEvent. I have a faulty thought to word translator Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. 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