T
Tim Zych
I'm displaying a tooltip related to a listbox based on the selected item.
It works well except when I move the cursor away from the listbox and then
hover back over it, the tooltip pops up history for each item I have
selected. For example, let's say I select an item. The tooltip pops up with
the text. Good. Then I select a 2nd item, and the tooltip shows that text.
Good. Then, I drag the cursor away from the listbox. The tooltip disappears.
Good. Then I drag it over the listbox. The tooltip will pop up 2 items,
which are the 2 previously-viewed items. Not good. If I select 20 listbox
items and perform the same steps, the tooltip displays 20 items when I
re-hover over the listbox. Not good.
What am I doing wrong?
Here's my code:
Private Sub MyListBox_SelectedIndexChanged(.....) Handles etc..
Dim t As Tooltip
Dim i as ItemClass
' Set a reference to the item to display additional info for
i = MyListBox.SelectedItem()
t = New Tooltip
With t
.ShowAlways = False
.InitialDelay = 50
.AutoPopDelay = 5000
.ReshowDelay = 1000
.SetToolTip(Me.MyListBox, i.MyExtraInfo)
End With
It works well except when I move the cursor away from the listbox and then
hover back over it, the tooltip pops up history for each item I have
selected. For example, let's say I select an item. The tooltip pops up with
the text. Good. Then I select a 2nd item, and the tooltip shows that text.
Good. Then, I drag the cursor away from the listbox. The tooltip disappears.
Good. Then I drag it over the listbox. The tooltip will pop up 2 items,
which are the 2 previously-viewed items. Not good. If I select 20 listbox
items and perform the same steps, the tooltip displays 20 items when I
re-hover over the listbox. Not good.
What am I doing wrong?
Here's my code:
Private Sub MyListBox_SelectedIndexChanged(.....) Handles etc..
Dim t As Tooltip
Dim i as ItemClass
' Set a reference to the item to display additional info for
i = MyListBox.SelectedItem()
t = New Tooltip
With t
.ShowAlways = False
.InitialDelay = 50
.AutoPopDelay = 5000
.ReshowDelay = 1000
.SetToolTip(Me.MyListBox, i.MyExtraInfo)
End With