1 Previous Next 

TreeView: Vary tooltip by node


This example uses the treeview's GetNodeAt method figure out which node the mouse is over. It then set the tooltip to the text of the node.
Private Sub trvNorthWind_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles trvNorthWind.MouseMove
Dim nd As TreeNode

Try
Dim pt As New Point(e.X, e.Y)
nd = trvNorthWind.GetNodeAt(pt)
ToolTip1.SetToolTip(trvNorthWind, nd.Text)
Catch
ToolTip1.SetToolTip(trvNorthWind, "")
End Try
End Sub



1 Previous Next