AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Listview checkbox

Ein Thema von Razor · begonnen am 22. Aug 2007 · letzter Beitrag vom 22. Aug 2007
Antwort Antwort
s-off
(Gast)

n/a Beiträge
 
#1

Re: Listview checkbox

  Alt 22. Aug 2007, 13:16
Try this:

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
   i: Integer;
   iChecked: 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
      case iChecked of
         0: Form1.Caption := 'No item is checked';
         1: Form1.Caption := 'One item is checked';
      end;
   end;
end;
Edit:
In addition you could store the indexes (Checked = True) in an array or similar.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:03 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz