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?
Set DropDownStyleto DropDownList.
DropDownStyle
DropDownList
Winforms:
comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
WPF:
comboBox.IsReadOnly = true; comboBox.IsEditable = false;
The rest cut out the WinForms combo box; for completeness, in WPF you need to install IsReadOnly = trueand IsEditable = false.
IsReadOnly = true
IsEditable = false