Board index » delphi » (no) Images in TreeViews ?

(no) Images in TreeViews ?

Hi everybody,

A question about the TreeView-Component in
DELPHI (5).

If I assign an ImageList to a TreeView,
then automatically every Node is displayed
with a symbol right before.
Even if I choose the ImageIndex = (-1), which means
<<no image>>, an empty (white) rectangle is displayed
before the Node instead of the image/symbol.

I only could get this empty (white) rectangle away
by cleaning the whole connection TreeView -- ImageList.

However, I want to use both types of Nodes in my TreeView,
Nodes with image/symbol and Nodes without (and so without
the white space before)

Any ideas how to solve this problem?

regards,

Mirko

 

Re:(no) Images in TreeViews ?


In article <Xns925CBDD5FD598brucknmunimuenste...@128.176.188.118>, Mirko

Quote
Brueckner <bruc...@uni-muenster.de> writes:
>However, I want to use both types of Nodes in my TreeView,
>Nodes with image/symbol and Nodes without (and so without
>the white space before)

>Any ideas how to solve this problem?

Make two bitmaps, one of  which is a horizontal line (one pixel wide and
dashed), and the other is a horizontal line plus a vertical line (also one
pixel wide and dashed) and use those as the image for "no image". You have to
position the lines in the bitmaps so that they line up with the tree-view
lines.

I'll send you a couple if you email me and I can find the ones I used <g>.

Alan Lloyd
alangll...@aol.com

Re:(no) Images in TreeViews ?


Hi Alan,

Just get your ideas right ... I'll have to use images
with a width of only 1 pixel, is that what you mean?

Do I have to change any properties (or use CustomDraw)
making it possible to display that 1-Pixel-Images ?
Because I thought it's a standard-Width there with the
symbols in the TreeView.

Quote
>> I'll send you a couple if you email me and I can find the
>> ones I used...

Please send them to me, I would be glad.
Thank's in advance.

Regards, Mirko

Quote
> Make two bitmaps, one of  which is a horizontal line (one pixel wide
> and dashed), and the other is a horizontal line plus a vertical line
> (also one pixel wide and dashed) and use those as the image for "no
> image". You have to position the lines in the bitmaps so that they
> line up with the tree-view lines.

Re:(no) Images in TreeViews ?


No, I think alan is suggesting that you need to use images that fake the
lines/crosses/whatever that normally display next to each item when you do
not have images turned on, to give the appearance of no image.

Cheers,
Nick

Quote
"Mirko Brueckner" <bruc...@uni-muenster.de> wrote in message

news:Xns925CE09E33B76brucknmunimuensterde@128.176.188.118...
Quote
> Hi Alan,

> Just get your ideas right ... I'll have to use images
> with a width of only 1 pixel, is that what you mean?

> Do I have to change any properties (or use CustomDraw)
> making it possible to display that 1-Pixel-Images ?
> Because I thought it's a standard-Width there with the
> symbols in the TreeView.

> >> I'll send you a couple if you email me and I can find the
> >> ones I used...

> Please send them to me, I would be glad.
> Thank's in advance.

> Regards, Mirko

> > Make two bitmaps, one of  which is a horizontal line (one pixel wide
> > and dashed), and the other is a horizontal line plus a vertical line
> > (also one pixel wide and dashed) and use those as the image for "no
> > image". You have to position the lines in the bitmaps so that they
> > line up with the tree-view lines.

Other Threads