TAB-key

  • Thread starter Thread starter Adrian
  • Start date Start date
A

Adrian

keypressed etc does not work for the tab key.
How can I catch the tab key having been pressed?
There is an article on MSDN but I cannot get the
code to work.

Is thare anything like KeyPess or KeyDown?
Could you please give an example?

Many thanks.
 
Hi Adrian,

In KeyUp event you can catch when the TAB key was pressed (release).

private void form1_keyUp ( ..., KeyEventArgs e)
{
if ( e.KeyCode == Keys.Tab )
MessageBox.Show ("TAB pressed");
}

Regards,
Peter
 
Many thanks Peter,

That works.I don't understand why KeyPressed and KeyDown
don't work, but KeyUp does work. Is there an explanation?

Adrian.
 
Back
Top