Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   XML (https://www.delphipraxis.net/46-xml/)
-   -   Delphi ListView, Column Count? (https://www.delphipraxis.net/41217-listview-column-count.html)

mav 27. Feb 2005 22:44


ListView, Column Count?
 
hello all :)

Ich habe eine frage..

wie kann ich aus einer ListView spezifisch eine Column Counted, welche den Eintrag -1 haben :)

hoffe jemand versteht das :D

toms 27. Feb 2005 22:55

Re: ListView, Column Count?
 
sorry, ich verstah di nöd....

mav 27. Feb 2005 23:07

Re: ListView, Column Count?
 
also.. ;)

ich habe eine xml -> listview (column 1-7)

nun möchte ich genau aus column[7] alle gezählt haben, welche den eintrag '-1' haben

wie mach ich das?

toms 27. Feb 2005 23:23

Re: ListView, Column Count?
 
etwa so:

Delphi-Quellcode:
for iLoop := 0 to Pred(ListView1.Items.Count) do
 if Listview1.Items[iLoop].SubItems[6] = '-1' then
 begin
  // ...
 end;
end;

mav 28. Feb 2005 17:26

Re: ListView, Column Count?
 
dass habe ich au schon :)
nun möchte ich aber das ganze in solch einer form

StatusBar1.Panels[0].Text := 'Need: '+IntToStr(MainForm.AppsList.Items.xxxxxx);

mav 1. Mär 2005 21:17

Re: ListView, Column Count?
 
dieses problem bringt mich früher oder später um die ecke.. ich komme einfach nicht vom fleck ;(

Luckie 1. Mär 2005 21:32

Re: ListView, Column Count?
 
Dann pack doch toms Code in eine Funktion, die dir dann die Eintrage mit -1 zurückgibt.

mav 1. Mär 2005 22:27

Re: ListView, Column Count?
 
sorry.. aber ich verstehe es nicht..

Luckie 1. Mär 2005 22:41

Re: ListView, Column Count?
 
Delphi-Quellcode:
type
  TForm1 = class(TForm)
  private
    { Private declarations }
    function Foo: Integer;
  public
    { Public declarations }
  end;
Delphi-Quellcode:
function TForm1.Foo: Integer;
var
  i: Integer;
  cnt: Integer;
begin
  cnt := 0;
  for iLoop := 0 to Pred(ListView1.Items.Count) do
    if Listview1.Items[iLoop].SubItems[6] = '-1' then
    begin
      Inc(cnt);
    end;
  end;
  result := cnt;
end;
Delphi-Quellcode:
StatusBar1.Panels[0].Text := 'Need: '+IntToStr(Foo);


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:50 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz