Hello, folks!

So i'm trying to add a tooltip to a treenode, But with no luck. I've tried things like:

Treeview.nodes(0).tooltiptext = "Hello"

Hi,

You should do something like this:

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
    Me.Controls.Add(treeViewWithToolTips)

End Sub

Thank you! Worked perfectly!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.