Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 16th, 2005, 04:50 AM
Authorized User
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dotnetprogrammer
Default TreeView - Please help

I have a treeview on my form. Now I need to assciate a Form object
with each node of the tree. The idea is whenever user clicks on a node,
then the currenly opened form (if any ) is closed and the form associated
with that node is opened.

How can I do that.
Actually I have to develop a custom control with a treeview which can also take an Form Object with every node. Idea is to when we click on the treeview, we will show that form and hide the last one.

Any kind of help will be greatly appreciated.

Regards
Saurabh

dotnet
__________________
dotnet
Reply With Quote
  #2 (permalink)  
Old September 5th, 2005, 09:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Hudson, MA, USA.
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can define a class which inherits from the TreeNode class. Your derived class can contain whatever information you need, and implement whatever properties and methods are appropriate, such as references to forms or whatever. Since these objects derive from TreeNode, they can be placed in the treeview and will behave just like TreeNodes, which, of course, is what they are.

You can then determine the selected node, and DirectCast it to your derived type. You can then retrieve whatever custom properties you have defined in your class and have it take appropriate action.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
treeview mahmutmol ASP.NET 2.0 Professional 0 August 21st, 2006 06:46 AM
treeview mahmutmol ASP.NET 2.0 Basics 0 August 21st, 2006 06:43 AM
treeview SAIGORTI SQL Language 2 September 6th, 2005 07:31 PM
Treeview dkr72 VBScript 0 November 9th, 2004 12:07 PM
treeview MANOJMETAL ADO.NET 1 April 17th, 2004 08:46 AM



All times are GMT -4. The time now is 05:13 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.