Make "Enter" Key respond like TAB?

Imfromtexas

Member
Joined
Mar 9, 2005
Messages
8
Programming Experience
Beginner
I have several input boxes that I have limited the keys to numbers, decimal, and enter, I would like to have the cursor move to the "next" input box when enter is pressed? Any help would be greatly appreciated.
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
there's no magic function for this so you're going to need to code each textbox to move to the next one.

in the textbox's KeyUp event:
VB.NET:
Private Sub Textbox2_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Textbox2.KeyUp
  If e.KeyValue = 13 Then Textbox3.Focus() 'Enter Key
  If e.KeyValue = 27 Then Textbox1.Focus() 'Escape Key
End Sub
 
Top Bottom