Set the items' 'Tag' property to the tooltip text and add a ToolTip
component to the form. Then add this code:
\\\
Private m_HoveredItem As ListViewItem
Private Sub ListView1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseMove
Dim lvi As ListViewItem = Me.ListView1.GetItemAt(e.X, e.Y)
If Not lvi Is m_HoveredItem Then
m_HoveredItem = lvi
If lvi Is Nothing Then
Me.ToolTip1.SetToolTip(Me.ListView1, "")
Else
Me.ToolTip1.SetToolTip(Me.ListView1, lvi.Tag)
End If
End If
End Sub
///
The code is untested, but it should basically work. If you find any
problems with the code, please let me know.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.