471,337 Members | 923 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

TreeStructure problem

Hi!

In my program I'm using a class, which can nested like the TreeNodes in a
TreeView, thus I also want to use a TreeView to display some of the content
(a short string) of these nested classes. The user shall then be able to take
further actions when by clicking on the TreeNodes. Here comes the problem:
How do I map the currently selected TreeNode to the appropriate instance of
the nested class?
Jul 21 '05 #1
2 918
On Sun, 20 Mar 2005 03:11:03 -0800, tommazzo wrote:
Hi!

In my program I'm using a class, which can nested like the TreeNodes in a
TreeView, thus I also want to use a TreeView to display some of the content
(a short string) of these nested classes. The user shall then be able to take
further actions when by clicking on the TreeNodes. Here comes the problem:
How do I map the currently selected TreeNode to the appropriate instance of
the nested class?


You could use the tag property of the treenode. In the tag property you can
store whatever you want. So for example the reference to the object the
treenode represents.
--
Claudio Grazioli
http://www.grazioli.ch
Jul 21 '05 #2


"Claudio Grazioli" wrote:
On Sun, 20 Mar 2005 03:11:03 -0800, tommazzo wrote:
Hi!

In my program I'm using a class, which can nested like the TreeNodes in a
TreeView, thus I also want to use a TreeView to display some of the content
(a short string) of these nested classes. The user shall then be able to take
further actions when by clicking on the TreeNodes. Here comes the problem:
How do I map the currently selected TreeNode to the appropriate instance of
the nested class?


You could use the tag property of the treenode. In the tag property you can
store whatever you want. So for example the reference to the object the
treenode represents.
--
Claudio Grazioli
http://www.grazioli.ch


Thanks a lot. That's exactly what I was looking for!
Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Bruce Davis | last post: by
8 posts views Thread by Thomas Weholt | last post: by
11 posts views Thread by Kostatus | last post: by
117 posts views Thread by Peter Olcott | last post: by
28 posts views Thread by Jon Davis | last post: by
6 posts views Thread by Ammar | last post: by
2 posts views Thread by Mike Collins | last post: by
reply views Thread by rosydwin | last post: by

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.