Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Text2.SetFocus End SubPrivate Sub Text2_GotFocus() Text2.SelStart = 0 Text2.SelLength = Len(Text2) End Sub
Private Sub Text1_Click() Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text) End SubPrivate Sub Text1_GotFocus() Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text)End Sub
在gotgocus中加入 With Text1 .SelStart = 0 .SelLength = Len(.Text) .SetFocus End With
If KeyAscii = 13 Then Text2.SetFocus
End SubPrivate Sub Text2_GotFocus()
Text2.SelStart = 0
Text2.SelLength = Len(Text2)
End Sub
text1.selectstart=0
text1.selectlenght=len(text1.text)就可以了
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End SubPrivate Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)End Sub
With Text1
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End With