unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;type
  TFormMouseDown = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  FormMouseDown: TFormMouseDown;implementation{$R *.dfm}procedure TFormMouseDown.FormCreate(Sender: TObject;
button: TMouseButton; Shift:TShiftState; X,Y: Integer);
var
btn: Tbutton
begin
Btn:=TButton.create(self);
btn.parent:=self;
btn.left:=x;
btn.top:=y;
btn.width:=btn.width+50;
btn.caption:=Format('Button at %d, %d', [x,Y]);end;end.高手指点错在哪了  怎么改正错误.
编译的时候 提示错误

解决方案 »

  1.   

    你的 button: TMouseButton; Shift:TShiftState; X,Y: Integer 是哪来的?
      

  2.   


    procedure FormCreate(Sender: TObject);
    procedure TFormMouseDown.FormCreate(Sender: TObject;
    button: TMouseButton; Shift:TShiftState; X,Y: Integer);声明和实现的参数不一样啊
      

  3.   


    procedure FormCreate(Sender: TObject);//写完后你同时按下Shift+Ctrl+C键
    把procedure TFormMouseDown.FormCreate(Sender: TObject;
    button: TMouseButton; Shift:TShiftState; X,Y: Integer);
    var
    btn: Tbutton
    begin
    Btn:=TButton.create(self);
    btn.parent:=self;
    btn.left:=x;
    btn.top:=y;
    btn.width:=btn.width+50;
    btn.caption:=Format('Button at %d, %d', [x,Y]);end;
    注释掉
      

  4.   

    FormCreate中怎么有button: TMouseButton; Shift:TShiftState; X,Y: Integer这些参数
      

  5.   


    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;type
      TFormMouseDown = class(TForm)
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      FormMouseDown: TFormMouseDown;implementation{$R *.dfm}procedure TFormMouseDown.FormCreate(Sender: TObject);
    var
    btn: Tbutton
    begin
    Btn:=TButton.create(self);
    btn.parent:=self;
    btn.left:=x;
    btn.top:=y;
    btn.width:=btn.width+50;
    btn.caption:=Format('Button at %d, %d', [x,Y]);end;end.
      

  6.   

    btn.caption:=Format('Button at %d, %d', [x,Y]);
    改一下
    btn.caption:='aa';
      

  7.   

    button创建 应写在FormShow事件里,FormCreate时Form还没创建你如何在Form上创建Button呢?
      

  8.   

    这个是点击创建组建的实例.是 DELPHP7入门与精通的例子 我怎么无法把他编译出来.
    高手指点一下