selecting text when clicking in textbox

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
 
D

Dan Artuso

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top