procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.buttononclick(Sender: TObject);
begin
case TSpeedButton(Sender).Tag of
1: showmessage('This is Test1');
2: showmessage('This is Test2');
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
ButtonTest:TSpeedButton;
btntop,
btnleft:Integer;
begin
btntop:=10;
btnleft:=10;
ButtonTest:=TSpeedButton.Create(Self);
With ButtonTest do
begin
tag:=1;
Caption:='test1';
parent:= self;
Top:=btntop;
Left:=btnleft;
onclick := buttononclick;
end;
btntop:=100;
btnleft:=100;
ButtonTest:=TSpeedButton.Create(Self);
With ButtonTest do
begin
tag:=2;
Caption:='test2';
parent:= self;
Top:=btntop;
Left:=btnleft;
onclick := buttononclick;
end;
end;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.buttononclick(Sender: TObject);
begin
case TSpeeedButton(Sender).Tag of
1: showmessage('This is Test1');
2: showmessage('This is Test2');
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
ButtonTest:TSpeeedButton;
btntop,
btnleft:Integer;
begin
btntop:=10;
btnleft:=10;
ButtonTest:=TButton.Create(Self);
With ButtonTest do
begin
tag:=1;
Caption:='test1';
parent:= self;
Top:=btntop;
Left:=btnleft;
onclick := buttononclick;
end;
btntop:=100;
btnleft:=100;
ButtonTest:=TButton.Create(Self);
With ButtonTest do
begin
tag:=2;
Caption:='test2';
parent:= self;
Top:=btntop;
Left:=btnleft;
onclick := buttononclick;
end;
end;