TAB-key

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.
 
G

Guest

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
 
A

Adrian

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top