Results 1 to 2 of 2

Thread: Selecting Text Automatically

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Posts
    1

    Question Selecting Text Automatically

    what is the best way to automatically select (hightlight) text in a text box when the focus is set to that box?

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    VB Code:
    1. Private Sub Text1_GotFocus()
    2.   With Text1
    3.     .SelStart = 0
    4.     .SelLength = Len(.Text)
    5.   End With
    6. End Sub

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width