Select all text with mouseover effect... how?[Resolved]
Hi:wave:
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
Re: Select all text with mouseover effect... how?
Quote:
Originally posted by EJ12N
Hi:wave:
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