Results 1 to 3 of 3

Thread: Highlighting the text in a text box

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2001
    Posts
    52
    Hello; I am new to the VB and I think its a simple question but I have no idea how to do it.

    Suppose I have some text boxes on a form and I filled out the text boxes with the required information. If I use the tab key to move to a text box already been filled with text, how can I have the text highlighted when that textbox got the focus.

    I hope you all understand my question.

    Thanks

  2. #2
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Sydney Australia
    Posts
    804
    Understood, how about:

    Code:
    Private Sub Text1_GotFocus()
    Me.Text1.SelStart = 0
    Me.Text1.SelLength = Len(Text1)
    End Sub
    Last edited by JamesM; Apr 19th, 2001 at 02:08 AM.

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2001
    Posts
    52

    Its Working

    Thankyou Very much JamesM

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