selecting text when clicking in textbox

  • Thread starter Thread starter george
  • Start date Start date
G

george

Hi,

What code do I need to use in order to select the whole
text in a textbox when I click in it?

thanks, george
 
Hi,
I suppose you could use something like this in the
Click event:

Private Sub fName_Click()
Me.fName.SelStart = 0
Me.fName.SelLength = Len(Me.fName)
End Sub

This is for a text box named fName
 
Back
Top