千
千中元
Unregistered / Unconfirmed
GUEST, unregistred user!
以前总觉得没有写控件的必要(懒惰的借口),好不容易下决心继承TDBEDit写了个,
还错误连篇
下面主要是要给DBEdit添加一个前
缀属性(Prifixtion),然后在OnExit的时候,把Prifixtion属性里的
值和TWaterBookEdit里的值相加,就组成流水帐的值.
type
TWaterBookEdit = class(TDBEdit)
private
GetPrefixion:string;
Fprefixion: string;
Procedure SetPrefixion(const value:string);
{ Private declarations }
protected
Procedure OnExit; override;
{ Protected declarations }
public
constructor create(AOwner:Tcomponent);override;
{ Public declarations }
published
Property prefixion:string read Fprefixion write Setprefixion;
read GetPrefixion write SetPrefixion;
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Md', [TWaterBookEdit]);
end;
{ TWaterBookEdit }
constructor TWaterBookEdit.create(AOwner: Tcomponent);
begin
inherited create(AOwner);
end;
procedure TWaterBookEdit.OnExit;
begin
inherited;
//把text换成text+前缀属性的值 ,但前缀的值怎么表是那??直接用不知道可以否?
text:=text+Prefixion;
end;
procedure TWaterBookEdit.SetPrefixion(const value: string);
begin
GetPrefixion:=Value;
end;
安装时候出现错误信息:
protected
Procedure OnExit; override;
------------[Error] WaterBookEdit.pas(17): Method 'OnExit' not found in base class
可TDbEdit明明有OnExit的.
是不是放错地方了?
还错误连篇
下面主要是要给DBEdit添加一个前
缀属性(Prifixtion),然后在OnExit的时候,把Prifixtion属性里的
值和TWaterBookEdit里的值相加,就组成流水帐的值.
type
TWaterBookEdit = class(TDBEdit)
private
GetPrefixion:string;
Fprefixion: string;
Procedure SetPrefixion(const value:string);
{ Private declarations }
protected
Procedure OnExit; override;
{ Protected declarations }
public
constructor create(AOwner:Tcomponent);override;
{ Public declarations }
published
Property prefixion:string read Fprefixion write Setprefixion;
read GetPrefixion write SetPrefixion;
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Md', [TWaterBookEdit]);
end;
{ TWaterBookEdit }
constructor TWaterBookEdit.create(AOwner: Tcomponent);
begin
inherited create(AOwner);
end;
procedure TWaterBookEdit.OnExit;
begin
inherited;
//把text换成text+前缀属性的值 ,但前缀的值怎么表是那??直接用不知道可以否?
text:=text+Prefixion;
end;
procedure TWaterBookEdit.SetPrefixion(const value: string);
begin
GetPrefixion:=Value;
end;
安装时候出现错误信息:
protected
Procedure OnExit; override;
------------[Error] WaterBookEdit.pas(17): Method 'OnExit' not found in base class
可TDbEdit明明有OnExit的.
是不是放错地方了?