Jump to content
Sign in to follow this  
WhyTea

Disable ComboBox editing

Recommended Posts

WhyTea

Is it possible to disable editing in a ComboBox while still allowing selection from the dropdown list? I.E. I would like the items in the ComboBox to be static.

/Why Tea

Share this post


Link to post
Share on other sites
Yashied

Share this post


Link to post
Share on other sites
Mat

Yes!! The editing is the default style, so to change it just set the style to: $CBS_DROPDOWNLIST (requires #include<ComboConstants.au3>), or 0x0003.

#include<ComboConstants.au3>

$hGUI = GUICreate ("Testing combo box")
GUICtrlCreateCombo ("", 2, 2, 100, 20, $CBS_DROPDOWNLIST)
GUICtrlSetData (-1, "Item 1|Item 2|Item 3", "Item 1")
GUISetState ()
While GUIGetMsg () <> -3
WEnd

Mat

  • Like 1

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.