C # Stop a person from entering options in the combo box dropdown

I have a combo box with elements inside, just wonders if it is possible to stop people from entering it and allow them to only select an element that is already there?

+5
source share
3 answers

Set DropDownStyleto DropDownList.

+10
source

Winforms:


comboBox.DropDownStyle = ComboBoxStyle.DropDownList;

WPF:


comboBox.IsReadOnly = true;
comboBox.IsEditable = false;
+6
source

The rest cut out the WinForms combo box; for completeness, in WPF you need to install IsReadOnly = trueand IsEditable = false.

+4
source

All Articles