|
-
Feb 21st, 2004, 03:31 PM
#1
Thread Starter
Hyperactive Member
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:
Private Sub txtID_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
With txtID
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End With
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! 
-
Feb 21st, 2004, 04:17 PM
#2
PowerPoster
VB Code:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
txtID.SelStart = 0
End Sub
-
Feb 21st, 2004, 04:26 PM
#3
Hyperactive Member
Re: Select all text with mouseover effect... how?
Originally posted by EJ12N
Hi
VB Code:
Private Sub txtID_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
With txtID
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End With
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
-
Feb 21st, 2004, 04:26 PM
#4
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|