BlackHoleSun Posted August 1, 2011 Posted August 1, 2011 Is there anything built-in that mimics the InputBox() but is able to have a drop down for different options instead of the input field? I would like to avoid multiple GUIs if possible.
wakillon Posted August 1, 2011 Posted August 1, 2011 (edited) Is there anything built-in that mimics the InputBox() but is able to have a drop down for different options instead of the input field? I would like to avoid multiple GUIs if possible. Something like this ? #include <GUIConstantsEx.au3> GUICreate("My GUI combo") $_Combo =GUICtrlCreateCombo("item1", 10, 10) GUICtrlSetData(-1, "item2|item3", "item3") GUISetState() $_ReadOld='' While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop $_Read = GUICtrlRead ( $_Combo ) If $_Read <> $_ReadOld Then ConsoleWrite ( "-->-- $_Read : " & $_Read & @Crlf ) $_ReadOld = $_Read EndIf WEnd Type what you want in the combobox ! Edited August 1, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
BlackHoleSun Posted August 1, 2011 Author Posted August 1, 2011 I have a main GUI now and I want a user to click a button and choose an option from a drop down, but don't want to go through the hassle of dealing with multiple GUIs if at all possible. I know what I would have to do if I'm forced to go with a sub GUI, but I was wondering if there was something I over-looked.
wakillon Posted August 1, 2011 Posted August 1, 2011 #include <GUIConstantsEx.au3> GUICreate("My GUI combo") $_Combo =GUICtrlCreateCombo("item1", 10, 10) GUICtrlSetData(-1, "item2|item3", "item3") $_Button = GUICtrlCreateButton ( 'Select', 20, 50 ) GUISetState() $_ReadOld='' While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $_Button ConsoleWrite ( "+->-- Select : " & GUICtrlRead ( $_Combo ) & @Crlf ) EndSwitch $_Read = GUICtrlRead ( $_Combo ) If $_Read <> $_ReadOld Then ConsoleWrite ( "-->-- $_Read : " & $_Read & @Crlf ) $_ReadOld = $_Read EndIf WEnd AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
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