Tooltip problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim Zych

    #1

    Tooltip problem

    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_Selec tedIndexChanged (.....) Handles etc..
    Dim t As Tooltip
    Dim i as ItemClass

    ' Set a reference to the item to display additional info for
    i = MyListBox.Selec tedItem()

    t = New Tooltip
    With t
    .ShowAlways = False
    .InitialDelay = 50
    .AutoPopDelay = 5000
    .ReshowDelay = 1000
    .SetToolTip(Me. MyListBox, i.MyExtraInfo)
    End With



  • ag

    #2
    Re: Tooltip problem

    What is "i.MyExtraI nfo" ???
    Explain.

    Comment

    • Tim Zych

      #3
      Re: Tooltip problem

      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.



      "ag" <name.new@gmail .comwrote in message
      news:1158743784 .565462.170670@ i3g2000cwc.goog legroups.com...
      What is "i.MyExtraI nfo" ???
      Explain.
      >


      Comment

      • Stuart Nathan

        #4
        Re: Tooltip problem

        I haven't checked your code, but my guess is the 'New' statement.
        You may need to dispose of the previous tooltip first.


        Comment

        • Tim Zych

          #5
          Re: Tooltip problem

          Exactly correct. Thanks!

          "Stuart Nathan" <stuart.nathan@ homecall.co.ukw rote in message
          news:uKrzcdN3GH A.2196@TK2MSFTN GP06.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.
          >
          >

          Comment

          Working...