emulate tab key

  • Thread starter Thread starter Starbuck
  • Start date Start date
S

Starbuck

HI

In a edit form which has text boxes is it possible to emulate TAB and
Shift-TAB with the UP & DOWN keys

Thanks in advance
 
yes have a look at SelectNextControl

'Example
Private Sub Textbox_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles txt1.KeyUp, txt2.KeyUp,
txt3.KeyUp
If e.KeyCode = Keys.Up Then
Me.SelectNextControl(CType(sender, Control), False, True, True, True)
ElseIf e.KeyCode = Keys.Down Then
Me.SelectNextControl(CType(sender, Control), True, True, True, True)
End If
End Sub
 
Many thanks


AMDRIT said:
yes have a look at SelectNextControl

'Example
Private Sub Textbox_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles txt1.KeyUp, txt2.KeyUp,
txt3.KeyUp
If e.KeyCode = Keys.Up Then
Me.SelectNextControl(CType(sender, Control), False, True, True, True)
ElseIf e.KeyCode = Keys.Down Then
Me.SelectNextControl(CType(sender, Control), True, True, True, True)
End If
End Sub
 
Back
Top