473,503 Members | 3,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TreeNode

Hi NG

i need a TreeNode with an attribute "depth", i.g. it has to be possible to skip one ore more levels of the tree explicitly
Example
Root--Node1--Node
Root-----------Node

Where do i find the Paint-Method or anything so that i can implement my own TreeNode

Thanx for any hel
Stefan
Nov 16 '05 #1
3 2495
If you want to add an attribute to a treenode you need to subclass your own
node.
public class myNode : TreeNode
{
int _depth = 0; // some default value

public myNode() // constructor :D
{
}

public int depth
{
get { return _depth; }
set { _depth = value; }
}
}

-C

http://www.typemismatch.com/
(For Developers!)

"Stefan" <an*******@discussions.microsoft.com> wrote in message
news:08**********************************@microsof t.com...
Hi NG,

i need a TreeNode with an attribute "depth", i.g. it has to be possible to skip one ore more levels of the tree explicitly. Example:
Root--Node1--Node2
Root-----------Node3

Where do i find the Paint-Method or anything so that i can implement my own TreeNode?
Thanx for any help
Stefan

Nov 16 '05 #2
Yes... but what i want is to paint the Tree in a different way. E.g. i need to rewrite the paint method somehow. But i do not know how it works

Do i have to override the OnPaint event handler

cheer
Stefan
Nov 16 '05 #3
Yes, you can override the OnPaint method of the Tree control or simply write
an OnPaint event handler but an override is better here.

Then you can draw whatever you want.

C

--
http://www.typemismatch.com/
(For Developers!)

"Stefan" <an*******@discussions.microsoft.com> wrote in message
news:CA**********************************@microsof t.com...
Yes... but what i want is to paint the Tree in a different way. E.g. i need to rewrite the paint method somehow. But i do not know how it works.
Do i have to override the OnPaint event handler?

cheers
Stefan

Nov 16 '05 #4

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

Similar topics

2
2383
by: Benny Raymond | last post by:
More problems with this... When I run this code, the main form returns an invalid cast exception as it's executing the line "TreeNode n = (TreeNode) this.Nodes;" Does anyone know what would...
0
1600
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
3274
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. ...
1
7305
by: jmDesktop | last post by:
I am trying to add nodes with keys to my treeview. I can add general nodes without problem with: //create new node TreeNode newNode = new TreeNode(myIdNumber); //create children TreeNode...
1
3264
by: AAaron123 | last post by:
If you see this posted twice - sorry. My news reader showed my first post as "No Longer Available" I have the following in a .css file. The treeNodes behave as if they were "a" elements. ...
0
7192
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
7064
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
7261
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
7315
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...
1
6974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4991
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.