How to make a ComboBox ReadOnly?

D

**Developer**

I want to have a ComboBox that is loaded programmically not except keyboard
inputs.

I tried in KeyDown not calling MyBase.OnKeyDown(e)
and also tried setting e.Handled = True but neither appear to suppress the
keyboard input.


Any suggestions I could try will be appreciated
 
D

**Developer**

By readonly I mean, I don't want the user adding text in the textbox. The
values in the DropDown are the only allowed values.

For example the dropDown values might be the US state names, and one of
these must be selected - no other values allowed.


Thanks
 
G

Guest

Developer,

You can set the combobox's DropDownStyle property to DropDownList to have
the combobox behave like a dropdown listbox.

Kerry Moorman
 
D

**Developer**

I did check the style an even tried something - I don't remember the name of
the style- but it wasn't OK. I must have missed DropDownList.

Thanks for the help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top