How to displays my own tooltip and a treeview ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I have a treeview control. I want when my user hovers over
certain nodes to display a tooltip for the user. How can I do
that?

tnx.
 
I tried to do that some days ago. but nothing got. I want to know that too.

but, I suggest you to modify a tooltip object when select a treenode, then
show it.
 

sorry, I need the tip only after I click on a node, how do I change this to
use the Click event?

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
 
Hi,

Try something like this in the treeview click event

Dim n As TreeNode

Try
n = TreeView1.GetNodeAt(TreeView1.MousePosition)
ToolTip1.SetToolTip(trvNorthWind, nd.Text)
Catch
ToolTip1.SetToolTip(trvNorthWind, "")
End Try


Ken
-----------------

sorry, I need the tip only after I click on a node, how do I change this to
use the Click event?

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
 
Back
Top