How to set icon to the tree view nodes and sub nodes in c#.net Visual studio 2003

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neehakale
    New Member
    • Aug 2007
    • 46

    How to set icon to the tree view nodes and sub nodes in c#.net Visual studio 2003

    I am making an application where i have the Tree Node name as" folder" and the files in the folder are excel files .

    I want to set icon for the folder and excel file icon for excel files...

    Do anybody of know way to do this???

    please help me its urgent
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    EDIT: This is for 2005, but the MSDN claims it should still work in .NET1.1
    This one should resolve pretty easy.
    Each of your TreeNodes has a .ImageIndex and ImageKey property (they seem to be roughly identical in function)
    Just set that to the correct image index in your imagelist.
    See if that works?

    Comment

    • neehakale
      New Member
      • Aug 2007
      • 46

      #3
      Could you pls explain me in a little bit detail that how to add this image list in a form...i have searched but m not getting...in the properties window for tree view there is property by name image list ,but it is not taking any values..pls tel me hw to add image list

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        You have to HAVE an imagelist to add it.

        Comment

        Working...