Thema: Delphi Count Checkbox?

Einzelnen Beitrag anzeigen

Tommy1988
(Gast)

n/a Beiträge
 
#7

Re: Count Checkbox?

  Alt 27. Jan 2007, 17:11
hallo ich habe das problem jetzt durch eure vorschläge "wunderbar" gelöst.

nur es ist so:
ich habe neben 10 Checkboxen auch 2 RadioButtons auf meinem Formular.

Delphi-Quellcode:
procedure TForm1.SpeedButton3Click(Sender: TObject);
var addieren_2, ergebnis_2, zahl_2,
zahl1_2, zahl2_2, zahl3_2, zahl4_2, zahl5_2,
zahl6_2, zahl7_2, zahl8_2, zahl9_2,zahl10_2,
anzahl_2 : real;
  n_2: Word;
begin
  n_2 := 0;
  if CheckBox3.Checked then n_2 := n_2 + 1;
  if CheckBox4.Checked then Inc(n_2);
  if CheckBox5.Checked then Inc(n_2);
  if CheckBox6.Checked then Inc(n_2);
  if CheckBox7.Checked then Inc(n_2);
  if CheckBox19.Checked then Inc(n_2);
  if CheckBox20.Checked then Inc(n_2);
  if CheckBox21.Checked then Inc(n_2);
  if CheckBox23.Checked then Inc(n_2);
  if CheckBox15.Checked then Inc(n_2);
  //Radios
  if RadioButton1.Checked then Inc(n_2);
  if RadioButton2.Checked then Inc(n_2);

  Label59.Caption := IntToStr(n_2);
 //... hier folg noch viel mehr und irgentwann kommt end;
end;
Nur leider zählt er die RadioButtons so wie ich sie dort eingetragen habe nicht mit

was ist da falsch?
  Mit Zitat antworten Zitat