Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / April 2005

Tip: Looking for answers? Try searching our database.

TreeNode with own icon

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stefan - 08 Mar 2004 10:56 GMT
Hi NG

i need a TreeView consisting of TreeNodes where each TreeNode has its own icon (some nodes can have the same icon). This one icon should be shown regardless if the node is active or not. How can i implement that? I am using C#

Thanks for any help
Stefan
PocketNerd - 08 Mar 2004 11:26 GMT
Hi Stefan

I am not exacly sure what you are trying to achieve, but you can make sure a TreeNode is visible by calling its EnsureVisible method. This will work regardless of its location in the tree, scrolling, icon etc

Does that help

RS
Stefan - 08 Mar 2004 11:36 GMT
what i actually want is to store the information about the icon within the TreeNode object, not within an ImageList

regard
stefan
Chris Murphy - 11 Apr 2005 19:07 GMT
What you're going to want to do is persist the treeview object in some
manner. The most common is serializing the treeview to XML but there are
members of the treeview class that are not serializable, so you'll need to
create a proxy class that captures/reflects the tree structure before it's
disposed. You can accomplish this in by either extending the treeview class
to add this funtionality or to keep things relatively generic, you can
write a supporting class/module to handle this. Now, as far as storing the
icon: Since you're serializing in one form or another, you'll want to
capture the SelectedIndex, SelectedImage properties (and an other ones you
want) these are Integers, which you can use to identify against an image
list in your applicatiom, the icon that's associated with the node. OR you
can extend the treeview control and handle the events that way.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.