Back

Creating a Button at run-time:

uses Buttons;

procedure TForm1.Button3Click(Sender: TObject);
var But1 : TButton;
begin
    But1 := TButton.Create(Self);
    But1.Parent := Form1;
    But1.Top := 100;
    But1.Left := 100;
    But1.Visible := True;
    But1.Show();
    But1.Caption := 'New Button';
end;


Back