How to displays my own tooltip and a treeview ?

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.
 
A

Allen St.Clair

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.
 
G

Guest


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
 
K

Ken Tucker [MVP]

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
 

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