Sign in to follow this  
Followers 0
BlackHoleSun

InputBox with Drop Down

4 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 ! Posted Image

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#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.0WIN 8.1 X64 - Other Example Scripts

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