Also ich gebe mich geschlagen, wenn man es wie Peter sagt macht geht es einfacher. Ich poste deshalb hier den einfachen Code:
Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
| procedure TForm1.Button1Click(Sender: TObject); var i: Integer; current: TCheckBox; begin for i := 1 to 10 do begin current := TCheckBox(FindComponent('CheckBox'+IntToStr(i))); current.State := cbChecked; end; end; |
Wenn jemand noch Vorschläge hat, ich bin für weitere Vereinfachungen offen.
@hansg:
Ich glaube deine Frage ist nun beantwortet.
There are only 10 types of people: those who understand binary and those who don't.