Capturing short cuts keys

  • Thread starter Thread starter Sandra
  • Start date Start date
S

Sandra

I have a form which has a combo box. If the user were to hit the key combo
of CTRL + L for eg then I would like to change the value in the combo - how
do I capture these events.

Thanks in advance
Sandra
 
Sandra said:
I have a form which has a combo box. If the user were to hit the key combo
of CTRL + L for eg then I would like to change the value in the combo - how
do I capture these events.

Register a handler for KeyDown and then do this

private void TextBox_OnKeyDown(object Sender, KeyDownEventArgs e)
{
if(e.Key == 'L' && e.Control)
{
change text
}
}

Warning, this is from memory, check out the KeyDownEventArgs for the
details.
 
Back
Top