Results 1 to 4 of 4

Thread: Select all text with mouseover effect... how?[Resolved]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2003
    Location
    In Front of my computer...
    Posts
    367

    Thumbs up Select all text with mouseover effect... how?[Resolved]

    Hi

    i just saw an effect in an application that i would like to do it
    the effect is... you have a textbox and if you move the mouseover the textbox the text highlights (select all) itself and if you move the mouse out of the textbox the text goes back to normal

    ok i got this easy part

    VB Code:
    1. Private Sub txtID_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2. With txtID
    3. .SelStart = 0
    4. .SelLength = Len(.Text)
    5. .SetFocus
    6. End With
    7. End Sub

    that selects all the text in the textbox when user moves the mouse over but when i move the mouse out of the textbox is still highlighted any way to get what i want...

    Thank you very much to whoever helps
    Last edited by EJ12N; Feb 21st, 2004 at 04:28 PM.
    Born to help others
    (If I've been helpful then please rate my post. Thanks)

    call me EJ or be slapped!

  2. #2
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089
    VB Code:
    1. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2. txtID.SelStart = 0
    3. End Sub

  3. #3
    Hyperactive Member temp_12000's Avatar
    Join Date
    Jan 2004
    Location
    LA, USA
    Posts
    411

    Re: Select all text with mouseover effect... how?

    Originally posted by EJ12N
    Hi

    VB Code:
    1. Private Sub txtID_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2. With txtID
    3. .SelStart = 0
    4. .SelLength = Len(.Text)
    5. .SetFocus
    6. End With
    7. End Sub

    Thank you very much to whoever helps
    u may try this:

    1) in the form:

    blnSelect = false

    private sub frmMain_MouseMove(........)
    .......
    if (blnSelect = true) then
    ' de-select text
    blnSelect = false
    end if

    ...

    end sub

    2) in txtID:
    select/de-select text according to blnSelect,
    then set blnselect value

    if the txtID includes many lines,
    this is more efficient, I think



  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2003
    Location
    In Front of my computer...
    Posts
    367
    Thank you!
    Born to help others
    (If I've been helpful then please rate my post. Thanks)

    call me EJ or be slapped!

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