Reputation: 790
I have winforms combobox. I have list of predefined values that i put into Items
collection. I want to let user choose only this values, but not to type their own.
What should i do?
Upvotes: 0
Views: 206
Reputation: 216293
Set the property DropDownStyle to ComboBoxStyle.DropDownList
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
Specifies that the list is displayed by clicking the down arrow and that the text portion is not editable. This means that the user cannot enter a new value. Only values already in the list can be selected. The list displays only if AutoCompleteMode is Suggest or SuggestAppend.
Upvotes: 1