unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 =
class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
Panel5: TPanel;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
PanelList: TList;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
PanelList := TList.Create;
with PanelList
do
begin
Add(Panel1);
Add(Panel2);
Add(Panel3);
Add(Panel4);
Add(Panel5);
end;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
if Assigned(PanelList)
then
PanelList.Free;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
// Panel3 sichbar machen
TPanel(PanelList[2]).Visible := True;
end;
end.