unit cerc1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs ,stdctrls ;
type
TForm1 = class(TForm)
private
procedure frommousedown(sender: tobject; button: tmousebutton;
shift: tshiftstate; x, y: integer);
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure tForm1.frommousedown(sender:tobject; button:tmousebutton; shift:tshiftstate; x,y:integer);
var
btn:tbutton;
begin
btn:=tbutton.create(self);
btn.Parent :=self;
btn.top:=x;
btn.left:=y;
btn.Width:=btn.Width +30;
btn.caption:=format('button at %d,%d',[x,y]);
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs ,stdctrls ;
type
TForm1 = class(TForm)
private
procedure frommousedown(sender: tobject; button: tmousebutton;
shift: tshiftstate; x, y: integer);
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure tForm1.frommousedown(sender:tobject; button:tmousebutton; shift:tshiftstate; x,y:integer);
var
btn:tbutton;
begin
btn:=tbutton.create(self);
btn.Parent :=self;
btn.top:=x;
btn.left:=y;
btn.Width:=btn.Width +30;
btn.caption:=format('button at %d,%d',[x,y]);
end;
end.
type
TForm1 = class(TForm)
procedure frommousedown(sender: tobject; button: tmousebutton;
shift: tshiftstate; x, y: integer);
private
{ Private declarations }
public
{ Public declarations }
end;
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TForm1 = class(TForm)
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
btn : TButton;
begin
Btn := TButton.Create(Self);
with Btn do begin
Parent := form1;
Top := 50;
Left := 50 ;
Width := 50;
Height := 50;
Caption := 'Hello';
end;end;end.
btn.top:=y;
btn.left:=x;