Treeview with ImageList...

P

paradox

I want to have a TreeView that shows an image on some items, but not
all. Basically, if a certain condition is true, a caution icon is
placed next to the treeview item. The problem is that, by adding a
ImageList to the TreeView, the ImageIndex property of the items in the
TreeView defaults to 0. I could put a blank icon in the ImageList and
make it the 0 index image, however, this makes an ugly space.

Would I have to create my own treeview class (inheriting from it) and
override certain methods to do this?

If so, are there any articles that describe how to do such a thing? As
in, an article describing how to change the way a inherited control
(such as treeview) draws (if drawing is where something like this would
take place)?

It is my understanding that if I did override functions like that, that
I'd have to code all the functionality it has by default; unless there
is a specific function within the treeview class that deals with
drawing the imagelist icons.

As opposed to an article, are there any books that discuss this
advanced topic of modifying the way existings controls work? One other
thing I wanted to do was have a treeview that was also a listview; a
treeview with columns of information. Thank you.
 
C

Carlos J. Quintero [.NET MVP]

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top