I would like to disable typing in a combobox without disabling the control. The user would still be able to use the drop-down list but would not be able to type.
How?
5 replies to this topic
#1
Posted 13 July 2006 - 03:35 PM
|
|
|
#2
Posted 14 July 2006 - 06:17 AM
This isn't so hard. You have to capture the keypress event for that control.
private: System::Void comboBox1_KeyPress(System::Object^ sender, System::Windows::Forms::KeyPressEventArgs^ e) {
e->Handled = true;
}
#3
Posted 14 July 2006 - 07:47 AM
Thanks lop, works perfect
#4
Posted 15 July 2006 - 07:28 AM
No problem!
#5
Posted 23 September 2008 - 02:49 PM
You have to do this:
myComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
myComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
#6
Posted 24 April 2012 - 07:17 PM
As answered by SpaceGhost, the best way to do this is
myComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top










