473,385 Members | 1,927 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,385 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 2489
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.