codice:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,StdCtrls;
type
TForm1 = class(TForm)
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
bottone : tbutton ;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
bottone := tbutton.create(self);
bottone.caption := 'prova';
bottone.top := 100;
bottone.left := 100;
bottone.parent := Self;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
bottone.free;
end;
end.
semplice no?
puoi distruggerlo e ricrearlo quante volte vuoi.
luke