Hi again,
There are several steps in this:
1. Add an ImageList control to your form (from the More Controls list in
the toolbox - where you found the treeview control). You can either use the
default name (which will be "ImageListn", where n is the next available
number for controls on your form), or rename it to something more
meaningful. The standard prefix for an imagelist control is "ils", so your
name could be "ilsMyImagesForTreeView", for example.
2. Right-click the imagelist control to access its properties. Use the
General tab to select the size of your icon images (they must all be the
same size). Use the Images tab to add your images to the imagelist;
remember the index number for each image; that's how you associate it with a
particular node (via the image and selectedimage parameters in the Nodes.Add
method (as described in Doug Steele's recent post to another thread of
yours).
3. The key step - in your treeview control's properties (Generaltab),
select or enter the name of your imagelist control. Now, when you populate
your treeview control, you can include the image and selectedimage indexes
to determine the icons shown.
I guess it would be possible to set up the imagelist programmatically, using
similar syntax to filling a treeview, but I've never done so. If I wanted
to do that, I would go and search in the MSDN library (I gave you a URL for
that in a previous post) to determine the exact syntax required.
HTH,
Rob