unit Unit1;
interface
uses Windows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
procedure TwojaProcedura(Sender: TObject);
public
end;
var Form1: TForm1; NewForm:Tform; button1:TButton;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
NewForm := TForm.Create(Application);
Newform.Show; Newform.Visible:=true;
Newform.Width:=40; Newform.Height:=70; Newform.Left:=10; Newform.Top:=10;
// FreeAndNil(NewForm);
end;
procedure TFORM1.TwojaProcedura(Sender: TObject);
begin
ShowMessage('Tralala');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
button1:=tbutton.Create(self);
Button1.OnClick := TwojaProcedura(button2);
end;
end.
podaje mi blad:"incomptibe types: TNotifyEvent and procedure untyped pointer or untyped prameter"
chchailbym aby jeszce ten button1 byl tworzony na stworzonej przeze mnie formie dynamicznie...