by Darkhacka (3 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 2nd February 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Select all text in a text box
API Declarations
No declarations...
'This function selects all text in a textbox
'Usage: Put code in the gotfocus event
'Usage: SelectAllTxt TextBoxName
Dim Search, Where
Where = InStr(TextBoxName.Text, Search)
If Where Then
TextBoxName.SelStart = Where - 1
TextBoxName.SelLength = Len(TextBoxName)
Exit Function
Else
Exit Function
End If
End Function