Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouse Up, Mouse Down... 2

Status
Not open for further replies.

RonRepp

Technical User
Feb 25, 2005
1,031
US
Hi all:

I am working with a ListView that I want to change the ToolTipText depending on which item is selected. Currently, I have this in the MouseMove event. This works fine, but stays as long as the mouse hovers over the listview.

Any suggestions?

Here is my code:


Private Sub LV1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)

Dim nPos As Integer 'find the position of the last \
Dim strF As String 'find the application name
nPos = InStrRev(LV1.SelectedItem.Text, "\")
strF = Mid(LV1.SelectedItem.Text, nPos + 1, Len(LV1.SelectedItem.Text))
LV1.ToolTipText = strF
End Sub

Thanks,

Ron

Ron Repp
 
The same behaviour is displayed if you set the tooltip at design time. I think that must be how it is meant to work.

Hope this helps

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
Hi,
Try putting that code in click event so that the tooltip text is shown just when the listview is clicked. Put the code 'LV1.ToolTipText = ""' in the MouseMove event so that it stops displaying text when the mouse starts moving. That can solve the 'always showing text' problem. Regards.
Joshua.
 
Does pop up the blank tooltip as a small box though...

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top