Thema: Delphi Listview checkbox

Einzelnen Beitrag anzeigen

Razor
(Gast)

n/a Beiträge
 
#10

Re: Listview checkbox

  Alt 22. Aug 2007, 15:19
This shows how many are selected but their index

Delphi-Quellcode:
var
   i: {array[0..50] of} integer;
   iChecked: Integer;
   b:integer;
begin
   iChecked := 0;

   for i := 0 to ListView1.Items.Count - 1 do begin
      if ListView1.Items[i].Checked then
         Inc(iChecked);
   end;

  { if iChecked > 1 then begin
      if iChecked < ListView1.Items.Count then
        Form1.Caption := 'some items are checked'
      else
         Form1.Caption := 'All items are checked';    }

 // end
   //else begin
       Form1.Caption:=inttostr(iChecked);


   //end;
end;
  Mit Zitat antworten Zitat