So irgendwie:
Delphi-Quellcode:
type
TForm1 = class(TForm)
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Loop: Cardinal;
begin
for Loop := 1 to 3 do
begin
with TCheckBox(FindComponent('Checkbox'+IntToStr(Loop))) do
begin
if Checked then
TLabel(FindComponent('Label'+IntTostr(Loop))).Visible := True
else
TLabel(FindComponent('Label'+IntTostr(Loop))).Visible := False;
end;
end;
end;
Aber ich bekomme immer in den TLabel-Zeilen ein
AV.