"tab" functionality in "enter key"??

rajesh.forum

Well-known member
Joined
Sep 7, 2007
Messages
55
Programming Experience
Beginner
Hi all!!!
I need perform "Tab" key operation i press "Enter" key in the textbox/or any other control


thanks,
rajesh
 
There exist software you can use to remap your keyboard, so you can swap Enter and Tab keys for example. Both keys have well-defined behaviour for different controls in all Windows Applications, and most users will expect this behaviour to be present.
 
There are times that this seems to be desirable, although I can't say I approve of it myself. If it's what you want then handle the KeyDown event, test for the Enter KeyCode and call the form's SelectNextControl method.
 
I know this works with textbox's keypress event, but I dont know if it works for other controls:

If e.KeyChar = ChrW(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If


- Mario
 
I know this works with textbox's keypress event, but I dont know if it works for other controls:

If e.KeyChar = ChrW(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If


- Mario

I would avoid using SendKeys unless there's a very specific reason for needing it
 
I know this works with textbox's keypress event, but I dont know if it works for other controls:

If e.KeyChar = ChrW(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If


- Mario
I would avoid using SendKeys unless there's a very specific reason for needing it
... and there is no need to here. The SelectNextControl method exists specificallt to select the next control. Why is it desirable to make the Enter key behave like the Tab key? Because the Tab key selects the next control. A match made in heaven.
 
Back
Top