Connecting Tech Pros Worldwide Forums | Help | Site Map

Treeview with ImageList...

paradox
Guest
 
Posts: n/a
#1: Nov 16 '05
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.


Carlos J. Quintero [.NET MVP]
Guest
 
Posts: n/a
#2: Nov 16 '05

re: Treeview with ImageList...


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" <dev@demiurgeinc.com> escribió en el mensaje
news:1108943402.605412.73830@c13g2000cwb.googlegro ups.com...[color=blue]
>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.
>[/color]


Closed Thread