|
-
Oct 27th, 2003, 04:52 PM
#1
Thread Starter
Member
Capture Shift+Tab
I have multiple text boxes that based on conditions the user is directed to different controls on the form. I need to be able to capture the shift+tab in order to determine which textbox they previously came from. Does anyone have any code or can point me in the right direction to do this?
Any and all help as always is greatly appreciated.
Thanks,
Tomson
-
Oct 27th, 2003, 04:58 PM
#2
PowerPoster
You need to handle the keydown event. If you need to capture at the form level, set the KeyPreview property to true. This code snippet is in C#, but it shouldn't be to hard to decipher. Let me know if you need translation.
Code:
private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) {
if (e.Shift && e.KeyCode == Keys.Tab) {
MessageBox.Show("Shift & Tab Pressed!");
}
}
-
Oct 27th, 2003, 05:01 PM
#3
Thread Starter
Member
Thanks a ton. I will try it. I worked in C++ but it has been many many many years ago. I will let you know if I need any additional help. If not, thanks again.
Tomson.
-
Oct 27th, 2003, 05:36 PM
#4
Thread Starter
Member
Okay, tried it but couldn't get it to work. It acts as if it is only capturing the shift key and not the tab key at the same time.
Translation would be appreciated.
Thanks,
Tomson
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|