By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,847 Members | 2,261 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,847 IT Pros & Developers. It's quick & easy.

Treeview with ImageList...

P: n/a
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.

Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Check this article of mine. I think I did that with the state image list for
some icons (notice the picture):
http://www.codeproject.com/vb/net/vb...tatechkbox.asp

For Multicolumn treeviews, it's VB6 code but it can help if you need to do
it yourself...
http://www.vbaccelerator.com/home/VB...ol/article.asp

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"paradox" <de*@demiurgeinc.com> escribió en el mensaje
news:11*********************@c13g2000cwb.googlegro ups.com...
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.

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.