Click here to Skip to main content
16,015,559 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
In my VS windows application, I have given search to my combo box but I want to restrict my user to add new item to the list. User should select the items shown when he/she type 1 or 2 letters.

What I have tried:

ComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
ComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
Posted
Updated 19-Apr-23 1:17am

1 solution

About the best you can do is set the DropDownStyle to ComboBoxStyle.DropDownList - the edit box can be typed in, but it can't be edited: only the preset items can be selected.
 
Share this answer
 
Comments
Member 11811771 19-Apr-23 10:04am    
Thanks for the reply. I have tried this too. It is taking new values also. The text box should take input for the search only, not for taking new values.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900