C# – How to disable editing of elements in combobox for c#

ccomboboxwinforms

I have some elements in a ComboBox (WinForms with C#). I want their content to be static so that a user cannot change the values inside when the application is ran. I also do not want the user adding new values to the ComboBox

Best Answer

Use the ComboStyle property:

comboBox.DropDownStyle = ComboBoxStyle.DropDownList;