不好意思再问一个组件编程有关问题
不好意思再问一个组件编程问题!
我想编一个控件,继承自Tedit控件,所做的唯一改变就是,增加一个新属性RowText,
需要满足的条件是:
RowText是string型,而且它的值随着edit.text值的改变而改变,也就是说它的值与edit.text的值同步,我编写了如下的代码,可是好象程序进入死循环,最后总是益出,请指教!谢谢!
unit TextEdit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type
TTextEdit = class(TCustomMemo)
private
{ Private declarations }
FRawText : string;
FText : string;
Flabel : Tlabel;
Fuseable : Boolean;
procedure Setuseable(AA: Boolean);
procedure Setlabel(Lb: Tlabel);
function GetRawText: String;
Procedure SetRawText(BB: string);
function GetText: String;
Procedure SetText(CC: string);
protected
public
constructor Create(AOwner: TComponent); override;
property RawText:string Read GetRawText write SetRawText;
published
{ Published declarations }
property Alignment default taLeftJustify;
property BorderStyle;
property CharCase;
property Color;
property Ctl3D;
property Font;
property visible;
property Text:string read GetText write SetText;
property MaxLength;
property PasswordChar;
property HideSelection;
property ImeMode;
property ImeName;
property ShowHint;
property TabOrder;
property TabStop;
property Title :Tlabel read Flabel write Setlabel;
property Useable: Boolean read Fuseable write Setuseable;
property ReadOnly;
property OnChange;
property OnClick;
property OnDblClick;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
我想编一个控件,继承自Tedit控件,所做的唯一改变就是,增加一个新属性RowText,
需要满足的条件是:
RowText是string型,而且它的值随着edit.text值的改变而改变,也就是说它的值与edit.text的值同步,我编写了如下的代码,可是好象程序进入死循环,最后总是益出,请指教!谢谢!
unit TextEdit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type
TTextEdit = class(TCustomMemo)
private
{ Private declarations }
FRawText : string;
FText : string;
Flabel : Tlabel;
Fuseable : Boolean;
procedure Setuseable(AA: Boolean);
procedure Setlabel(Lb: Tlabel);
function GetRawText: String;
Procedure SetRawText(BB: string);
function GetText: String;
Procedure SetText(CC: string);
protected
public
constructor Create(AOwner: TComponent); override;
property RawText:string Read GetRawText write SetRawText;
published
{ Published declarations }
property Alignment default taLeftJustify;
property BorderStyle;
property CharCase;
property Color;
property Ctl3D;
property Font;
property visible;
property Text:string read GetText write SetText;
property MaxLength;
property PasswordChar;
property HideSelection;
property ImeMode;
property ImeName;
property ShowHint;
property TabOrder;
property TabStop;
property Title :Tlabel read Flabel write Setlabel;
property Useable: Boolean read Fuseable write Setuseable;
property ReadOnly;
property OnChange;
property OnClick;
property OnDblClick;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;