Results 1 to 5 of 5

Thread: Tooltip for Item

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2000
    Location
    South Africa
    Posts
    40

    Tooltip for Item

    Hi,

    Does anyone know how to make different tooltips for each item in a listview, tree, grid, etc. The tooltip must be something that is not necessarily displayed in the control.

    Thanks in advance,

    Linda

  2. #2
    New Member
    Join Date
    Oct 2002
    Location
    Cincinnati, OH
    Posts
    2
    this would be helpful to me too.

    Linda_SA....thanks for the example on adding listitems. That helped me out alot

  3. #3
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394
    Hi

    I'm not sure if this answers your question or not. But you could just have the one tooltip for the list box, and assign it a different value for when the SelectedIndex changes.

    Maybe keep all the tooltips in an array with the same offset as the Index to be tipped.

    VB Code:
    1. Private Sub lstBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstBox.SelectedIndexChanged
    2.  
    3.          Me.tltToolTip.SetToolTip(lstBox, mstrTip(lstbox.SelectedIndex))
    4.  
    5.    End Sub

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I think you'd have to dynamically change the tooltip binding according to what is selected, basically on the AfterSelect event.

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2000
    Location
    South Africa
    Posts
    40
    I thought it would be something you set in the MouseHover event, because you don't necessarily want to select an item to see the tooltip.

    I thought something like:

    Private Sub ListView1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.MouseHover
    Me.ToolTip1.SetToolTip(Me.ListView1, ListView1.GetItemAt(MousePosition.X, MousePosition.Y).Text)
    End Sub

    but this does not work. GetItemAt returns nothing.

    Any ideas?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width