0

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.

user3418036
  • 103
  • 2
  • 4
  • 14
  • 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 Answers3

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:

enter image description here

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 Different Styles

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
1

You can set ComboBox.DropDownStyle to ComboBoxStyle.DropDownList.

spongebob
  • 8,370
  • 15
  • 50
  • 83