Click here to Skip to main content
15,663,413 members
Please Sign up or sign in to vote.
0.00/5 (No votes)

I have a c# and I have a combo box.
I entered the values I want the user to choose from to the combo box items list.

The user still has an option to put the cursor on the combo box and type whatever he wants.
How can I disable this option, and don't allow the user to type anything in the combo box?
I want the user to be able only to choose values from the items list I created.


Change the property DropDownStyle as DropDownList then user can not edit items from Combo box.
Share this answer
user_code 23-Oct-12 9:06am    
Braj_12 23-Oct-12 9:21am    
ur welcome.
Look carefully at the properties of the combo box. One of them does what you want.
Since your profile does not provide any information , I can't know whether more detailed information would be relevant.

Hope this helps,
Share this answer
user_code 23-Oct-12 9:06am    
That was exactly my question, which of the properties.
But never mind, I got the answer.

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