473,545 Members | 2,081 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 2511
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*******@disc ussions.microso ft.com> wrote in message
news:08******** *************** ***********@mic rosoft.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*******@disc ussions.microso ft.com> wrote in message
news:CA******** *************** ***********@mic rosoft.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
2388
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 cause this? I just want to be able to use my own node class so that I can store extra data... =========================
0
1603
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 open the file all the time.I tried creating an application in ASP.NET but its difficult getting an exact node to delete,insert etc b-cos of the XML...
0
3283
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. Provide following view properties to listview, through View menu a. Tile b. Icon
1
7324
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 myPersonNode = new TreeNode(myPerson); TreeNode myAddressNode = new TreeNode(myAddress);
1
3266
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. I can't get them to not respond to the mouse!
0
7468
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7401
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7423
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5972
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5329
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.