Is it possible lock the combobox so that the text can not be deleted/erased or modified. And make only choose the items? Thank you in advance. Hope is it possible.
Asked
Active
Viewed 1.6k times
0
-
Possible duplicate of [How can I make a ComboBox non-editable in .NET?](https://stackoverflow.com/questions/85702/how-can-i-make-a-combobox-non-editable-in-net) – Felipe Jun 01 '17 at 21:24
3 Answers
3
Set the "DropDownStyle" property of the combobox to DropDownList. This will allow only items in the list to be selected and will not allow any user input:

Leo Chapiro
- 13,678
- 8
- 61
- 92
3
Option 1
Simply set the ComboBox.Enabled
to False
- that way they can't change the values!
Option 2
Otherwise, use the dropDownStyle:
make DropDownStyle
property to DropDownList
instead of DropDown
For more information
Read this article (yes, it's written in c#, but the properties are the same!)
the above image displays this quite well.
EDIT
There is also a question previously asked here that asked a similar question.

Community
- 1
- 1

jbutler483
- 24,074
- 9
- 92
- 145