Highlights the text in any textbox that receives focus!
Highlights the text in any textbox that receives focus!
Rate Highlights the text in any textbox that receives focus!
(1(1 Vote))
'function to see the magic work. Examples are listed later in this code.
Public Function txtGotFocus()
For i = 0 To Form1.Count - 1
Set obj = Form1.ActiveControl
If TypeOf obj Is TextBox Then
obj.SelStart = 0
obj.SelLength = Len(obj.Text)
End If
Next i
End Function
'This demostrates the use of TextBox arrays
Private Sub Text1_GotFocus(Index As Integer)
txtGotFocus
End Sub
'This demostrates the use of just normal multiple TextBoxes
'Just attach the "txtGotFocus" command to any textbox GotFocus event.
Private Sub Text2_GotFocus()
txtGotFocus
End Sub
Highlights the text in any textbox that receives focus! Comments
No comments yet — be the first to post one!
Post a Comment