469,348 Members | 1,461 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,348 developers. It's quick & easy.

Treeview with ImageList...

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
1 6279
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.

Similar topics

1 post views Thread by Anthony Boudouvas | last post: by
3 posts views Thread by frazer | last post: by
3 posts views Thread by feel | last post: by
1 post views Thread by Tom | last post: by
1 post views Thread by Webster | last post: by
reply views Thread by Sarika | last post: by
1 post views Thread by Jeffrey Walton | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.