vb中如何让文本框在处于焦点状态下时,文本框中的文本处于选中状态?

2024-12-04 23:25:45
推荐回答(2个)
回答1:

Private Sub Text1_GotFocus()

Text1.SelStart = 0
Text1.SelLength = Len(Text1)
End Sub

回答2:

Private Sub Text1_GotFocus()

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

End Sub