Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendKey in VB.net

Status
Not open for further replies.

buddyel

MIS
Joined
Mar 3, 2002
Messages
279
Location
US

I am looking for help on how to use SendKey to allow me to hit ENTER instead of TAB to go through a form. Any help is greatly appreciated!!!
 
let me guess, you are trying to make the program run like the DOS version of it and your users will @#$% if they have to learn anything new.

Anyway my first thought is the code below, but it does not seem to work. Maybe something in there will spark an idea.

Protected Overrides Sub OnKeyPress(ByVal e As System.Windows.Forms.KeyPressEventArgs)
If e.KeyChar = System.Windows.Forms.Keys.Enter.ToString Then
Me.ProcessTabKey(True)
End If
End Sub

My idea was to have one piece of code per form that looked at every key stroke and if it was a "Enter" then run through to the next vaild tab controled control.

I hope this can spark an idea from someone.

Kris
[pc3]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top