How to disable editing of items in a combo box in c#?

When working in Win forms using C# and especially when you use the combo box , you would have noticed that by default the user can edit the values inside during the runtime.

How to disable editing of items in a combo box in c# (win forms) ?

Assuming that the combobox name is combobox1 , here the code to get this behavior.

comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
Tags :

Leave Your Comment

Liked this content?. Please spread the word :)