Question

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

Was it helpful?

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

OTHER TIPS

  private void combobox1_KeyPress(object sender, KeyPressEventArgs e)
  {
      e.Handled = true;
  }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top