Search code examples
c#comboboxeditselectedindex

Combo box c# not allow modify selected index


I got a combobox and i want that the string of the selected index will not be possible to edit
how can i do it?
thanks


Solution

  • If you want to block the ability to edit the textbox portion of a combobox you should set

     combobox1.DropDownStyle = ComboBoxStyle.DropDownList;
    

    or set the same property using the Properties list in the Form Designer