最好不要用左箭头和右箭头
用上下箭头(39,37分别该为38,40)
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 39 Then
If Index < Text1.Count - 1 Then
Text1(Index + 1).SetFocus
Else
Text1(Text1.LBound).SetFocus
End If
ElseIf KeyCode = 37 Then
If Index > Text1.LBound Then
Text1(Index - 1).SetFocus
Else
Text1(Text1.Count - 1).SetFocus
End If
Private Sub Text1_KeyUp(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 37 Then
Text1(Index - 1).SetFocus
ElseIf KeyCode = 39 Then
Text1(Index + 1).SetFocus
End If
End Sub