Ich habe das jetzt mal getestet und so geht's definitiv:
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
procedure tagsichtbar(Mytag: TLabel);
begin
if Mytag.Visible
then Form1.Memo2.Lines.Add(Mytag.
name);
end;
begin
for i := 1
to 4
do begin
tagsichtbar(FindComponent('
Label'+inttostr(i))
as TLabel);
end;
end;
end.
Weiß nicht, was du sonst noch anders hast?