473,396 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How can i catch tab+shift

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?

Jul 11 '06 #1
2 4533
Override the ProcessCmdKey method of the Form:

http://msdn2.microsoft.com/en-us/lib...esscmdkey.aspx

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

Big thicks are made up of lots of little thins.
"sytemper" <li*******@gmail.comwrote in message
news:11**********************@s13g2000cwa.googlegr oups.com...
>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?

Jul 11 '06 #2
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

"sytemper" <li*******@gmail.comwrote in message
news:11**********************@s13g2000cwa.googlegr oups.com...
>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?

Jul 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

147
by: Sateesh | last post by:
Hi, I am a beginner in Python, and am wondering what is it about the indentation in Python, without which python scripts do not work properly. Why can't the indentation not so strict so as to give...
15
by: Grant Edwards | last post by:
Is there any utility to convert Python sources from space-based block indentation to tab-based? You can use "expand" convert from tabs->spaces, but "unexpand" isn't bright enough to do the...
0
by: Michael Howes | last post by:
I'm trying to handle a number of keystrokes in a TextBox and for other reasons I'm using the KeyDown I'm trying to know when Shift-Tab is pressed and the following code doesn't work if ( (...
2
by: orekinbck | last post by:
Hi There In a C# windows app in .NET 2003, I would like to capture when the user is within a certain text box and holds down shift then presses tab. Atm, my code is: protected override bool...
10
by: Tim Frawley | last post by:
I am attempting to detect a Shift+Tab in the KeyPress event for back navigation on a control that doesn't support this method. Does anyone have any ideas how to compare e.KeyChar to a ShiftTab? ...
0
by: Gene Hubert | last post by:
I've got this working but I've got to wonder if there's not a better way. I'm capturing the tab and shift-tab keys in a datagrid and doing custom processing. Also, the form designer gets...
2
by: Don | last post by:
It took me a while to find this code, so I decided to post it here for others who might also be looking for a way to trap tab key presses. You can extend a control and place this code in it to...
1
by: Gernot Frisch | last post by:
Hi, I want to be able to select 3 rows of a textarea, and when pressing "Tab/shift Tab" indent the source code edited. Can I do this with JavaScript? -- -Gernot int main(int argc, char**...
1
by: andmarti | last post by:
Anyone can help me getting the shift + tab key combination ? I tried with getch () but with no success. May be using the sys.stdin ?? Please, help would be very appreciated. -- Andrés M....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.