实例表单中的继承是这样写的: TForm5 = class(TFormPP)
虽然在对象观察器中看不到,但写代码时它还是可以感应出来,比如在button1.click中写到 self. 后,列表框中有新方法名称存在.
请帮忙看一下,万分感谢!unit FormPP;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TFormPP = class(TForm)
private
FNewEnabled :Boolean;
FOnSetNewEnabled :TNotifyEvent;
{ Private declarations }
protected
public
procedure SetNewEnabled(const Value:Boolean);
{ Public declarations }
published
property NewEnabled :Boolean read FNewEnabled write SetNewEnabled;
property OnSetNewEnabled :TNotifyEvent read FOnSetNewEnabled write FOnSetNewEnabled;
end;implementation
{$R *.dfm}
//----------
procedure TFormPP.SetNewEnabled(const Value:Boolean);
begin
FNewEnabled:=Value;
if assigned(FOnSetNewEnabled) then
FOnSetNewEnabled(self);
end;
end.
虽然在对象观察器中看不到,但写代码时它还是可以感应出来,比如在button1.click中写到 self. 后,列表框中有新方法名称存在.
请帮忙看一下,万分感谢!unit FormPP;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TFormPP = class(TForm)
private
FNewEnabled :Boolean;
FOnSetNewEnabled :TNotifyEvent;
{ Private declarations }
protected
public
procedure SetNewEnabled(const Value:Boolean);
{ Public declarations }
published
property NewEnabled :Boolean read FNewEnabled write SetNewEnabled;
property OnSetNewEnabled :TNotifyEvent read FOnSetNewEnabled write FOnSetNewEnabled;
end;implementation
{$R *.dfm}
//----------
procedure TFormPP.SetNewEnabled(const Value:Boolean);
begin
FNewEnabled:=Value;
if assigned(FOnSetNewEnabled) then
FOnSetNewEnabled(self);
end;
end.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货