Results 1 to 7 of 7

Thread: [RESOLVED] [2008] Highlight a textbox

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Resolved [RESOLVED] [2008] Highlight a textbox

    Hi to all:

    I would like highlight a textbox when this textbox got the focus...
    I had search in the properties of the textbox but i can't see any propertie that could do this...

    Any suggestion to do this?

    Thanks
    Last edited by sacramento; Oct 6th, 2008 at 07:03 AM.

  2. #2
    Lively Member
    Join Date
    Jan 2007
    Posts
    96

    Re: [2008] Highlight a textbox

    What do you mean highlight the textbox? Highlight a certain word in the box? Change the background color of the textbox?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: [2008] Highlight a textbox

    Highlight the text in a textbox

  4. #4
    Lively Member
    Join Date
    Jan 2007
    Posts
    96

    Re: [2008] Highlight a textbox

    All of it?

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: [2008] Highlight a textbox

    yes...all the text

  6. #6
    Lively Member
    Join Date
    Jan 2007
    Posts
    96

    Re: [2008] Highlight a textbox

    Code:
        Private Sub TextBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.GotFocus
            TextBox1.SelectionStart = 0
            TextBox1.SelectionLength = TextBox1.Text.Length
        End Sub
    Worked for me. Hope this helps.

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: [2008] Highlight a textbox

    Hi:

    Very simple and work very well..


    Thanks a lot

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