Home Forums WinForms controls Other WinForms controls Wincombobox Reply To: Wincombobox

User (Old forums)
Member
Post count: 23064

You can handle the KeyDown event, and prevent the key press to be forwarded to the control.

i.e.:
<code>
private void Form1_Load( object sender, EventArgs e )
{
winComboBox1.TextBoxArea.KeyDown += new KeyEventHandler( TextBoxArea_KeyDown );
}

void TextBoxArea_KeyDown( object sender, KeyEventArgs e )
{
if( e.KeyCode == Keys.Down || e.KeyCode == Keys.Up )
{
e.SuppressKeyPress = true;
}
}
</code>

Imported from legacy forums. Posted by André (had 307 views)