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
Printable View
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
this would be helpful to me too.
Linda_SA....thanks for the example on adding listitems. That helped me out alot
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
I think you'd have to dynamically change the tooltip binding according to what is selected, basically on the AfterSelect event.
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?