Board index » delphi » TListView -> How can I get subitems from TListView

TListView -> How can I get subitems from TListView

I'm trying to get hold on subitems.

Can someone help me?

ListView.Caption := 'Text for Caption';
ListView.SubItems.Add('Text for SubItem 1');
ListView.SubItems.Add('Text for SubItem 2');

For caption:
        Text := ListView.Selected.Caption;

For SubItem 1:
        ???????

Thanks in advance

 

Re:TListView -> How can I get subitems from TListView


Quote
In article <31BC552E.6...@marel.is>, Jens Bjarnason <j...@marel.is> wrote:
>I'm trying to get hold on subitems.

>Can someone help me?

>ListView.Caption := 'Text for Caption';
>ListView.SubItems.Add('Text for SubItem 1');
>ListView.SubItems.Add('Text for SubItem 2');

>For caption:
>    Text := ListView.Selected.Caption;

>For SubItem 1:
>    ???????

>Thanks in advance

Try :-
        Text:=ListView1.Selected.subitems[1]

Re:TListView -> How can I get subitems from TListView


try this :
        somestring := ListView1.Selected.SubItems.Strings[n], where
        n is Nr of needed substring (0 - first, 1 - second and so on)

Re:TListView -> How can I get subitems from TListView


On Mon, 10 Jun 1996 18:02:38 +0100, Jens Bjarnason <j...@marel.is>
wrote:

Quote
>I'm trying to get hold on subitems.

>Can someone help me?

>ListView.Caption := 'Text for Caption';
>ListView.SubItems.Add('Text for SubItem 1');
>ListView.SubItems.Add('Text for SubItem 2');

>For caption:
>    Text := ListView.Selected.Caption;

>For SubItem 1:

The SubItems property is a string list:

{ Assign 'Text for SubItem 1' to Text. }
Text := ListView.Selected.SubItems[0]
--
Ray Lischner                              li...@tempest-sw.com
Tempest Software, Corvallis, Oregon, USA  http://www.tempest-sw.com

Other Threads