var
Form1: TForm1;
Nid :Longint;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
btn : Tbutton;
begin
btn:=Tbutton.Create(nil);
btn.Top := 20;
btn.Left := 40;
btn.Caption := 'NPbutton';
btn.Name := 'btn';
btn.Parent := TWincontrol(Nid);
btn.Show;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if notebook1.PageIndex<2 then
notebook1.PageIndex := Notebook1.PageIndex +1
else
Notebook1.PageIndex :=0;
edit1.Text := inttostr(Notebook1.pageindex);
Nid:=Longint(Notebook1.Controls[Notebook1.pageindex]);
end;
end.