Home All Groups Group Topic Archive Search About
Author
19 Sep 2006 11:12 PM
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

Author
20 Sep 2006 9:16 AM
ag
What is "i.MyExtraInfo" ???
Explain.
Author
20 Sep 2006 2:28 PM
Tim Zych
I'm loading data into the listbox using a class.

ExtraInfo is a member of that class. ExtraInfo is some extra info related to
the selected item, added to the tooltip to provide the user with more
information about their selection.



Show quoteHide quote
"ag" <name.***@gmail.com> wrote in message
news:1158743784.565462.170670@i3g2000cwc.googlegroups.com...
> What is "i.MyExtraInfo" ???
> Explain.
>
Author
20 Sep 2006 5:08 PM
Stuart Nathan
I haven't checked your code, but my guess is the 'New' statement.
You may need to dispose of the previous tooltip first.
Author
22 Sep 2006 10:45 PM
Tim Zych
Exactly correct. Thanks!

Show quoteHide quote
"Stuart Nathan" <stuart.nat***@homecall.co.uk> wrote in message
news:uKrzcdN3GHA.2196@TK2MSFTNGP06.phx.gbl...
> I haven't checked your code, but my guess is the 'New' statement.
> You may need to dispose of the previous tooltip first.
>
>