Dim a() As Byte
a = StrConv(Text1(Index), vbFromUnicode)
If UBound(a) + 1 >= 16 Then
ReDim Preserve a(15) As Byte
Text1(Index).Text = StrConv(a, vbUnicode)
If Index < Text1.UBound Then
Text1(Index + 1).SetFocus
Text1(Index + 1).SelStart = Len(Text1(Index + 1))
End If
End If
Dim a() As Byte
a = StrConv(Text1, vbFromUnicode)
If UBound(a) + 1 >= 16 Then
ReDim Preserve a(15) As Byte
Text1(Index).Text = StrConv(a, vbUnicode)
If Index < Text1.UBound Then
Text1(Index + 1).SetFocus
End If
End If
首先吧text控件的maxlength设为8
Private Sub Text1_Change()
If Len(Text1.Text) = 8 Then Text2.SetFocus
End Sub
```
Private Sub Text9_Change()
If Len(Text9.Text) = 8 Then Text10.SetFocus
End Sub