Board index » delphi » ListView/ListItem indenting

ListView/ListItem indenting

I am filling a ListView with ListItems, and there are some items I want to
indent using the indent property.  
e.g. Coffe Flavor, Blueberry Flavor, Walnuts, Pecans are indented.
Artificial Flavor
   Coffee Flavor
   Blueberry Flavor
Nuts
   Walnuts
   Pecans

The easy way to do it is to prefix the information with a few spaces.
ListItem := Items.Add;
ListItem.Caption := '   ' + Data.QANMSTR.FieldByName('CATEgory').AsString;

But I want to use the indent feature instead, except that no matter what
integer I assign to ListItem.Indent, the item will not indent.  Why is
this?
ListItem := Items.Add;
ListItem.Indent := 500;
ListItem.Caption := Data.QANMSTR.FieldByName('CATEgory').AsString;

 

Re:ListView/ListItem indenting


Each indentation is about 16 pixels.  So, if you set Indent or whatever the
property is to 2, then it will be indented by about 32 pixels.

You must be in vsReport view for it to be applicable.

Cameron
_______________________
cameronm...@hotmail.com

Quote
John Kaney wrote in message <01be52fb$e604dd60$1d0ea8c0@kaney>...

>I am filling a ListView with ListItems, and there are some items I want to
>indent using the indent property.
>e.g. Coffe Flavor, Blueberry Flavor, Walnuts, Pecans are indented.
>Artificial Flavor
>   Coffee Flavor
>   Blueberry Flavor
>Nuts
>   Walnuts
>   Pecans

>The easy way to do it is to prefix the information with a few spaces.
>ListItem := Items.Add;
>ListItem.Caption := '   ' + Data.QANMSTR.FieldByName('CATEgory').AsString;

>But I want to use the indent feature instead, except that no matter what
>integer I assign to ListItem.Indent, the item will not indent.  Why is
>this?
>ListItem := Items.Add;
>ListItem.Indent := 500;
>ListItem.Caption := Data.QANMSTR.FieldByName('CATEgory').AsString;

Re:ListView/ListItem indenting


The kicker is the ListView viewstyle is vsReport... and no matter value
what the ListView.Indent is set to... it doesn't indent.

Thanks for your response, though.

Cameron McCormack <NOSPAMcameronm...@hotmail.com> wrote in article
<79mjv1$fs...@news.alphalink.com.au>...

Quote
> Each indentation is about 16 pixels.  So, if you set Indent or whatever
the
> property is to 2, then it will be indented by about 32 pixels.

> You must be in vsReport view for it to be applicable.

> Cameron
> _______________________
> cameronm...@hotmail.com

Other Threads