Einzelnen Beitrag anzeigen

Benutzerbild von Sprint
Sprint

Registriert seit: 18. Aug 2004
Ort: Edewecht
712 Beiträge
 
Delphi 5 Professional
 
#6

Re: Variable mit Kompo auflösen

  Alt 26. Dez 2004, 22:29
@onlinehome:

Delphi-Quellcode:
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.
Ciao, Sprint.

"I don't know what I am doing, but I am sure I am having fun!"
  Mit Zitat antworten Zitat