How to add Tooltip text to Treeview

  • Thread starter Duraiswamy Lingappan
  • Start date
D

Duraiswamy Lingappan

Hi,
I need to add tooltip text for each node in treeview control.
I am using tree view in Excel Userform.
How to add tooltip text to treeview?.

If i use the following example it is giving the following error:
Method or Data member not found.
It is complaining 'TreeView1.TooltipText' method not found at line
TreeView1.TooltipText = nodx.Tag

Private Sub Form_Load()
Dim nodx As Node
Set nodx = TreeView1.Nodes.Add(, , "r", "Root")
nodx.Tag = "tooltip text for root"
nodx.Expanded = True

Set nodx = TreeView1.Nodes.Add("r", tvwChild, "c1", "Child")
nodx.Tag = "tooltip text for child"
nodx.Expanded = True

Set nodx = TreeView1.Nodes.Add("child1", tvwChild, "level2c1",
"Sub-Child")
nodx.Tag = "tooltip text for sub-child"
nodx.Expanded = True
End Sub

Private Sub TreeView1_MouseMove(Button As Integer, Shift As Integer, x As
Single, y As Single)
Dim nodx As Node
Set nodx = TreeView1.HitTest(x, y)

If Not nodx Is Nothing Then
TreeView1.ToolTipText = nodx.Tag
Else
TreeView1.ToolTipText = ""
End If
End Sub

How to rectify this problem??

Thanks in advance.

Regards
Duraiswamy
 

Ask a Question

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.

Ask a Question

Top