L
leway
Unregistered / Unconfirmed
GUEST, unregistred user!
我從自建了一個窗體類TMyForm = class(TfmParent),TfmParent = class(TForm),我想在TMyForm中override MouseDown方法,可編譯總報錯:Declaration of 'MouseDown' differs from previous declaration。
我檢查過聲明和定義是一樣,這是為什麼?
代碼如下:
unit frmParent;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TfmParent = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
fmParent: TfmParent;
implementation
{$R *.dfm}
end.
unit MyFormClass;
interface
uses
Forms,MyClassType,Controls,Classes,StdCtrls,SysUtils,Dialogs,frmParent,Graphics,frmMain,common;
type
TMyForm = class(TfmParent)
private
{Private declarations}
// procedure InitList;
// moved:boolean;
public
{ Public declarations }
procedure MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); override;
end;
implementation
uses
UseConst,frmObjInspctr,frmMaster,QControls;
//=============================================||
// Class Method MouseDown ||
//=============================================||
procedure TMyForm.MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
inherited;;
end.
我檢查過聲明和定義是一樣,這是為什麼?
代碼如下:
unit frmParent;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TfmParent = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
fmParent: TfmParent;
implementation
{$R *.dfm}
end.
unit MyFormClass;
interface
uses
Forms,MyClassType,Controls,Classes,StdCtrls,SysUtils,Dialogs,frmParent,Graphics,frmMain,common;
type
TMyForm = class(TfmParent)
private
{Private declarations}
// procedure InitList;
// moved:boolean;
public
{ Public declarations }
procedure MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); override;
end;
implementation
uses
UseConst,frmObjInspctr,frmMaster,QControls;
//=============================================||
// Class Method MouseDown ||
//=============================================||
procedure TMyForm.MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
inherited;;
end.