Sep 25, 2002 #1 johnsun1976 Programmer Joined Jan 28, 2002 Messages 34 Location CA Hi. I'm wondering how I can capture the Enter key and send a tab to go to the next control? Thanks John
Hi. I'm wondering how I can capture the Enter key and send a tab to go to the next control? Thanks John
Dec 5, 2003 #2 AHint Programmer Joined Sep 12, 2003 Messages 20 Location GB I am wondering the same. Can anyone out there advise? Upvote 0 Downvote
Dec 5, 2003 #3 phinoppix Programmer Joined Jul 24, 2002 Messages 437 Location US To trap Enter keys, you can handle this through KeyDown event. To move to the next available control, call SelectNextControl() method. Something like... Code: void urctrl_KeyDown(object sender, KeyEventArgs e) { if(e.KeyCode == Keys.Enter) urctrl.SelectNextControl(urctrl, true, true, true, true); } Check out documentation of KeyDown, KeyPress, KeyUp and SelectNextControl(). Hope this helps! Upvote 0 Downvote
To trap Enter keys, you can handle this through KeyDown event. To move to the next available control, call SelectNextControl() method. Something like... Code: void urctrl_KeyDown(object sender, KeyEventArgs e) { if(e.KeyCode == Keys.Enter) urctrl.SelectNextControl(urctrl, true, true, true, true); } Check out documentation of KeyDown, KeyPress, KeyUp and SelectNextControl(). Hope this helps!