A
Aaron
Why is this happening...In both text boxes I have the same code for
the KeyDown event but when I'm in the txtEndMiles box (in other words
it has the focus) and press the center button, or enter button, it
throws the cursor in the txtStartMiles and executes the Keys.Return
section...why?
Private Sub txtStartMiles_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles txtStartMiles.KeyDown
If e.KeyCode = Keys.Up Then
If txtEndMiles.Focus Then
txtStartMiles.Focus()
Else
txtStartMiles.Focus()
End If
End If
If e.KeyCode = Keys.Down Then
If txtStartMiles.Focus Then
txtEndMiles.Focus()
Else
txtStartMiles.Focus()
End If
End If
If e.KeyCode = Keys.Return Then
If txtStartMiles.Focus Then
Dim numPad As New frmNumPad
numPad.txtEntry.Text = Me.txtStartMiles.Text
numPad.Text = "Route Tracker"
Me.Text = ""
numPad.Show()
ElseIf txtEndMiles.Focus Then
Dim numPad As New frmNumPad
numPad.txtEntry.Text = Me.txtEndMiles.Text
numPad.Text = "Route Tracker"
Me.Text = ""
numPad.Show()
End If
End If
End Sub
the KeyDown event but when I'm in the txtEndMiles box (in other words
it has the focus) and press the center button, or enter button, it
throws the cursor in the txtStartMiles and executes the Keys.Return
section...why?
Private Sub txtStartMiles_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles txtStartMiles.KeyDown
If e.KeyCode = Keys.Up Then
If txtEndMiles.Focus Then
txtStartMiles.Focus()
Else
txtStartMiles.Focus()
End If
End If
If e.KeyCode = Keys.Down Then
If txtStartMiles.Focus Then
txtEndMiles.Focus()
Else
txtStartMiles.Focus()
End If
End If
If e.KeyCode = Keys.Return Then
If txtStartMiles.Focus Then
Dim numPad As New frmNumPad
numPad.txtEntry.Text = Me.txtStartMiles.Text
numPad.Text = "Route Tracker"
Me.Text = ""
numPad.Show()
ElseIf txtEndMiles.Focus Then
Dim numPad As New frmNumPad
numPad.txtEntry.Text = Me.txtEndMiles.Text
numPad.Text = "Route Tracker"
Me.Text = ""
numPad.Show()
End If
End If
End Sub