473,395 Members | 1,341 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,395 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 2490
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: 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: 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...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.