VB文本框文本全部选中 text2.selstart=0 Text2.SelLength = Len(Text2.Text) 还是不对我哪儿错了

2024-12-31 18:31:41
推荐回答(3个)
回答1:

Private Sub Command1_Click()

With Text2

.SelStart = 0
.SelLength = Len(.Text)
.SetFocus

End With

End Sub

回答2:

Private Sub Command1_Click()
Text2.SelStart = 0
Text2.SelLength = Len(Text2.Text)
Text2.SetFocus
End Sub
这样应该可以了

回答3:

text2.SetFocus