473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Adding tooltip to TreeView node

Hi!
How to add tooltip to a TreeView node?

Thanks for any advice!

Dmitry.
Nov 15 '05 #1
1 10120


Hi!
How to add tooltip to a TreeView node?


Here is one way that you could do:
Fill out the tag property for the treenodes and on mousemove event, update
the tooltip control with the tag property of the current node.

private void Form1_Load(object sender, System.EventArgs e)
{
TreeNode rootNode = this.treeView1.Nodes [0];
rootNode.Tag="This is the node 0";
rootNode.Nodes[0].Tag="this is node 1";
rootNode.Nodes[0].Nodes[0].Tag="this is node 2";

}

private void treeView1_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e)
{

TreeNode currentNode = this.treeView1.GetNodeAt(e.X,e.Y);
if (null != currentNode)
{
if (currentNode.Tag.ToString() !=
this.toolTip1.GetToolTip(this.treeView1).ToString( ))
{
this.toolTip1.SetToolTip(this.treeView1,currentNod e.Tag.ToString());
}
}
else
{
this.toolTip1.SetToolTip(this.treeView1,"");
}
}
Hope this helps.
--
Adrian Mascarenhas, Developer Division

This posting is provided "AS IS" with no warranties, and confers no rights.

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ALI-R | last post by:
I am showing the InnerXml of a node (in a treeView Control) in a tooltip ,but it is not formatted well ,all the elements after each other ,is there a way to format the innertext in a tooltip. ...
1
by: ALI-R | last post by:
I am showing the InnerXml of a node (in a treeView Control) in a tooltip ,but it is not formatted well ,all the elements after each other ,is there a way to format the innertext in a tooltip. ...
4
by: pmcguire | last post by:
I have a treeview with a lot of nodes. I want to load only the nodes that are initially visible when the form loads, and then continue to populate it in background and/or when the nodes are required...
1
by: Boni | last post by:
Dear all, I have a window with a treeview. If resize this window, so that some node text don't fit into window then a tooltip will be shown immediately when howering such (and only such node). The...
5
by: Pavan | last post by:
My goal is to accomplish the tooltip functionality for all the neodes in a tree view and i have the following three Events in my C# application. Name of my TreeView Control (AITreeView) 1)...
3
by: Vikram | last post by:
how to show tooltip for the tree nodes in the treecontrol of ms web controls in asp.net 1.0
1
by: Richard | last post by:
I'm trying to mimic how the TreeView shows a full text inplace tooltip when the mouse hovers over of TreeView node whose text is truncated due to skinny form or panel. In the IDE I have...
6
by: SQACSharp | last post by:
I'm using the EnumChildWindows API with an EnumChildWndProc callback to populate the treeview. The output will be something similar to spy+ + How can I specify the parent when adding a new node...
1
by: Bart Steur | last post by:
Hi As a VB6 user I'm unfamiliar with the Treeview control of VB2005. I read it was changed but I have a hard time finding the right help/samples for my problem. In VB6 you had 1 collection,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.