ShowNodeToolTips Property

TreeView.ShowNodeToolTips Property


Gets or sets a value indicating ToolTips are shown when the mouse pointer hovers over a TreeNode.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

Public Property ShowNodeToolTips As Boolean

Property Value

Type: System.Boolean

true if ToolTips are shown when the mouse pointer hovers over a TreeNode; otherwise, false. The default is false.

In order for ToolTips to be visible, you must set the ToolTipText for a TreeNode.

The following code example demonstrates how to use the ToolTipText and ShowNodeToolTips properties. To run this example, paste the following code into a Windows Form and call InitializeTreeViewWithToolTips from the form's constructor or Load event handler.

Private treeViewWithToolTips As TreeView

Private Sub InitializeTreeViewWithToolTips() 
    treeViewWithToolTips = New TreeView()
    Dim node1 As New TreeNode("Node1")
    node1.ToolTipText = "Help for Node1"
    Dim node2 As New TreeNode("Node2")
    node2.ToolTipText = "A Tip for Node2"
    treeViewWithToolTips.Nodes.AddRange(New TreeNode() {node1, node2})
    treeViewWithToolTips.ShowNodeToolTips = True

End Sub

.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft