Selected Text in text box

  • Thread starter Thread starter Peter Cole
  • Start date Start date
P

Peter Cole

If i Tab from one text box I have the options set so that
the contents are selected. any sugestions how I can make
it so that if i use the mouse the text is selected.

Thanks
Peter Cole
 
Using the Mouse Up or Click event of the control try something like

Me.txtNameOfTextbox.SelStart = 0
Me.txtNameOfTextbox.SelLength = Len(Me.txtNameOfTextbox.Text)

I tried the Enter and Got Focus events, but apparently they fired before the
mouse click was done and so the highlight got erased. The Mouse Up event is
late enough to avoid this problem.
 
Back
Top