unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
FMyButtonList:TList;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i:Integer;
begin
for I := 0
to FMyButtonList.Count -1
do
with TButton(FMyButtonList[i])
do
begin
Height := 50;
Width := 100;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
i:Integer;
begin
FMyButtonList:=TList.Create;
for I := 0
to ControlCount - 1
do
if Controls[i]
is TButton
then
if TButton(Controls[i]).Tag=123
then //oder eine andere Art der Identifizierung
FMyButtonList.add(Controls[i]);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
FMyButtonList.Free;
end;
end.