How to make a ComboBox ReadOnly?

  • Thread starter Thread starter **Developer**
  • Start date Start date
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
 
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
 
Developer,

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

Kerry Moorman
 
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!
 
Back
Top