How can i catch tab+shift

S

sytemper

I write a keydown KeyDown event to catch if tab is press or tab+shift
is press.And i already override the IsInputKey method.
But noe i only can get the tab but no shift+tab. When shift+tab is
press, i only get KeyCode=ShiftKey,and KeyData=65552, but nothing to
show that tab is also pressed.
What should i do now?
 
C

Claes Bergefall

When KeyCode = Tab, examine the KeyEventArgs.Shift property. It will tell
you if the Shift key is pressed or not

private void Control_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Tab && e.Shift)
// Shift + Tab
else if (e.KeyCode == Keys.Tab && !e.Shift)
// Tab
}

/claes
 

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