472,141 Members | 1,594 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 software developers and data experts.

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 6487
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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.