Jump to content
Sign in to follow this  
new2this

ComboBox: limit user input to drop-down selections

Recommended Posts

new2this

I have a gui that populates several combo boxes within it. How do I go about limiting the user to selecting only from the drop down items, not allowing them to type in their own input?

Thanks ahead of time!

Share this post


Link to post
Share on other sites
SmOke_N

Style: $CBS_DROPDOWN


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
new2this

So, simply...$cmbCreate = GuiCtrlCreateCombo("",350, 160, 141, 25, $CBS_DROPDOWN)

THis should keep the end user from being able to enter their own text in the combo box? If thats the case, then I've done something else wrong.

Share this post


Link to post
Share on other sites
SmOke_N

So, simply...$cmbCreate = GuiCtrlCreateCombo("",350, 160, 141, 25, $CBS_DROPDOWN)

THis should keep the end user from being able to enter their own text in the combo box? If thats the case, then I've done something else wrong.

Sorry...
#include <GUIConstantsEx.au3>
GUICreate("")
GUICtrlCreateCombo ("", 10,10, -1, -1, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1,"1|2|3")
GUISetState ()
While GUIGetMsg() <> -3
WEnd
Exit

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
new2this

Wonderful! Adding the $CBS_DROPDOWNLIST instead of the $CBS_DROPDOWN did the trick. Thanks for your help, SmOke_N!!

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.