我要做一个文本框通过回车键聚焦并选择其中字符的功能,如果输入错误或通过别的什么事件触发聚焦也可以选择其中的字符,可是实现不了:
Private Sub text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
Text2.SelLength = Len(Text2.Text)
End If
End Sub
请大家指点!
Private Sub text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
Text2.SelLength = Len(Text2.Text)
End If
End Sub
请大家指点!
sendkey "{Home}+{End}"
If KeyAscii = 13 Then
Text2.SetFocus
text2.SelStart=0
Text2.SelLength = Len(Text2.Text)
End If
End Sub