|
-
Oct 30th, 2002, 09:14 AM
#1
Thread Starter
Member
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
-
Oct 30th, 2002, 10:27 AM
#2
New Member
this would be helpful to me too.
Linda_SA....thanks for the example on adding listitems. That helped me out alot
-
Oct 30th, 2002, 11:30 AM
#3
Hyperactive Member
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:
Private Sub lstBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstBox.SelectedIndexChanged
Me.tltToolTip.SetToolTip(lstBox, mstrTip(lstbox.SelectedIndex))
End Sub
-
Oct 30th, 2002, 11:30 AM
#4
I think you'd have to dynamically change the tooltip binding according to what is selected, basically on the AfterSelect event.
-
Oct 31st, 2002, 12:59 AM
#5
Thread Starter
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|