Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TListView subitems

Status
Not open for further replies.

801119

Programmer
Apr 10, 2000
311
SE
Greetings all...

I'm so tried that I can't think correct at the moment (it's 0100 |-I ) and I was wondering if it's possible to extract info from just 1 of the subitmes in a TlistView?
I could desperately need something else then SubString.. I'm so sick and tired of it! X-) My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work
 
Are you looking for something like:
Code:
 String Something = ListView1->Items->Item[0]->Caption;
?
James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
No, not really.... lets say that you have a TListView with 1 item in it and 3 columns looking something like this
Code:
------------------------------------
Name        |     Size |      Date |
------------------------------------
Hello.com        300 kb  2001-02-03
It was added using this code
Code:
TListItem *pItem;
pItem = FileList->Items->Add();
pItem->Caption = ffblk.ff_name;
pItem->SubItems->Add( "300 kb" );
pItem->SubItems->Add( "2001-02-03" );
and when I select the Item I want to find either the first or second SubItem (or anyother, if more exists)
But the only code I've know of that takes the subitem text is FileList->Selected->SubItems->GetText() My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work
 
Greetinx!

SubItems property is the TStrings ancestor so it has a property which gain access to any of sub string in that TString object. Name of this propeety is *Strings*. I think what you can access of your either *Size* or *Date* column value using record of *FileList->Selected->SubItems->Strings[0]* or *FileList->Selected->SubItems->Strings[1]* consequently. Happy programming!))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top