Sign in to follow this  
Followers 0
new2this

ComboBox: limit user input to drop-down selections

5 posts in this topic

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



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

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

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

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  
Followers 0