sensalim Posted October 30, 2007 Posted October 30, 2007 I have a combo (dropdown) box... with 2 or 3 items in it. How do I do it so that if the user changes the dropdown from item1 to item2 or whatever, it would call a function You know, like in html-java script: <select name="test" onchange="dothat()"> ... </select> What about in Autoit? Thanks.
Nahuel Posted October 30, 2007 Posted October 30, 2007 I suppose you'd have to do something like this: #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) GUICreate("Form1", 306, 118, 218, 121) $Combo1 = GUICtrlCreateCombo("", 30, 34, 245, 100) GUICtrlSetData(-1,"Fred|Jhonny|Jack","Jebus") GUICtrlSetOnEvent(-1,"_ComboRead") GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE,"_quit") While 1 Sleep(100) WEnd Func _Quit() Exit EndFunc Func _ComboRead() $sName=GUICtrlRead($Combo1) MsgBox(0,"",$sName) EndFunc
sensalim Posted October 30, 2007 Author Posted October 30, 2007 That worked. Now is there a way to have a button that scroll this combo box down and another to scroll it up? Thanks.
sensalim Posted October 30, 2007 Author Posted October 30, 2007 OK I think I will use UDF GUICombo.au3 but when I use that, I get this error "Line 61 (File Misc.au3"): Local $p = DllStructCreate($struct) Local $p = ^ ERROR Error: Unknown function name" What do I do? Thanks.
sensalim Posted October 30, 2007 Author Posted October 30, 2007 Fixed. I was not using the latest autoit version. Thanks!
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