473,386 Members | 1,823 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,386 software developers and data experts.

is it possible to have dynamic labels for TreeNode?

I was wondering if it was at all possible to make the label of a TreeNode
dynamic- calling a specific method or property whenever it needs to obtain a
label to draw?

The reason is I'd like to have a number printed in the label, which
indicates how many children that node has (recursive)

so if this was a file system tree for example, I might have D:\ which has
the number 1,250 next to it (how many files in all of my D drive), then you
expand that and each folder in turn has a number showing how many files under
it, etc... down to every last folder.
Nov 16 '05 #1
1 1270
Yes, but you have to code it yourself. Some examples to study:

Customizing a Control's Appearance Using Custom Draw
http://msdn.microsoft.com/library/de...w/custdraw.asp,

SAMPLE: CustDTv Illustrates Custom Draw in a TreeView
http://support.microsoft.com/default...;EN-US;q248496

vbAccelerator TreeView Control
http://www.vbaccelerator.com/home/VB...ol/article.asp

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"MrNobody" <Mr******@discussions.microsoft.com> escribió en el mensaje
news:4E**********************************@microsof t.com...
I was wondering if it was at all possible to make the label of a TreeNode
dynamic- calling a specific method or property whenever it needs to obtain
a
label to draw?

The reason is I'd like to have a number printed in the label, which
indicates how many children that node has (recursive)

so if this was a file system tree for example, I might have D:\ which has
the number 1,250 next to it (how many files in all of my D drive), then
you
expand that and each folder in turn has a number showing how many files
under
it, etc... down to every last folder.

Nov 16 '05 #2

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

Similar topics

7
by: pizzy | last post by:
PROBLEM: I CAN'T GET THE LAST RESUTS TO WORK CORRECTLY. I WOULD PROVIDE THE CODE (AND WILL IF REQUESTED). BUT IN MY OWN WORDS I AM TRYING TO HAVE THE FIRST FORM DYNAMICALLY CREATE INPUT BOXES...
14
by: placid | last post by:
Hi all, i have this struct for a binary tree node typedef struct treenode { char *word; struct treenode *right; struct treenode *left; }TreeNode;
1
by: Ehsan | last post by:
What i want to achieve(in runtime): A root named "Home" with nodes added to it named "A","B","C" and so on til "Z". I want these subnodes named accordingly Home_A, Home_B and so on, in the code...
4
by: DS | last post by:
Can anyone think of a way or point me in the right direction to be able to get a multiline treeview? By this I mean that each TreeNode Label can span say 2 lines (delimited by \n)? Thanks! -Dan
0
by: naija naija | last post by:
Hi All, I'm using the TreView Web Control for my MENU. And the Menu is populated from an XML file below. I want a way in which i can manipulate the XML when i want to manage it without having to...
0
by: fred | last post by:
I am using the clipboard to copy and paste a TreeNode but the Tag property does not seem to be copied. I use the Tag property for an Object that contains data relating to the TreeNode. The Tag...
0
by: drop | last post by:
Hi, I'm currently working with the Treeview control in ASP .Net 2.0. The tree is filled dynamically based on data contained in a MySQL Database. Here is the exact behavior I want : 1 - User...
1
by: nsvmani | last post by:
Hi, i am trying to get the FileOpen dialogue window as soon as clicked href link I am using IE6 with ActiveX enabled. Just need to get the File Open dialogue window when i click on the HREF links.It...
0
by: zlf | last post by:
Hello, My application needs to use TreeView (or something like that, once the appearance matchs tree, it is ok) as navigation control, whose TreeNode is neither single text nor single navigation...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.