unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure SomeButtonEvent(Sender: TObject );
public
{ Public declarations }
end;
var
Form1: TForm1;
t1:tbutton;
implementation
{$R *.dfm}
procedure TForm1.SomeButtonEvent( Sender:TObject );
begin
ShowMessage( 'Сообщениее');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
t1:=TButton.Create(Application);
t1.Left:=100;
t1.Top:=100;;
t1.Parent := form1;
t1.OnClick := SomeButtonEvent;
end;
end.
Все работает(хотя только что ошибку давал)
Сообщение отредактировано: Client -