Setting these options on your comobobox will lead to the trick you are looking for, Combo is on, but no one can change or enter anything like that. Appearance = Enabled, Behavior = Disabled :)
comboBox1.DropDownHeight = 1; comboBox1.KeyDown += (s, e) => e.Handled = true; comboBox1.KeyPress += (s, e) => e.Handled = true; comboBox1.KeyUp += (s, e) => e.Handled = true;
If for some reason you cannot use lambdas, then subsequent handlers may be bound. Right click -> Paste if you have DropDownStyle = DropDown.
//void comboBox1_KeyUp(object sender, KeyEventArgs e) //{ // e.Handled = true; //} //void comboBox1_KeyPress(object sender, KeyPressEventArgs e) //{ // e.Handled = true; //} //void comboBox1_KeyDown(object sender, KeyEventArgs e) //{ // e.Handled = true; //}
source share