473,320 Members | 2,097 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,320 software developers and data experts.

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 2485
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
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
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: 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
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
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.