D
dyxfkj
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
Type
TcyEdit = Class(TEdit)
private
fIsBol: Boolean;
published
property IsBol: Boolean Read fIsBol Write fIsBol Default True;
end;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
cyEdit: TcyEdit;
begin
cyEdit := TcyEdit.Create(Self);
cyEdit.Parent := Form1;
// cyEdit.IsBol := true; 在设计时不能进行设置么?
if cyEdit.fIsBol then
ShowMessage('Yes')
else
ShowMessage('No');
if cyEdit.IsBol then
ShowMessage('Yes')
else
ShowMessage('No');
end;
end.
1、cyEdit的值永远为false
2、设计时不能进行定义么?
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
Type
TcyEdit = Class(TEdit)
private
fIsBol: Boolean;
published
property IsBol: Boolean Read fIsBol Write fIsBol Default True;
end;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
cyEdit: TcyEdit;
begin
cyEdit := TcyEdit.Create(Self);
cyEdit.Parent := Form1;
// cyEdit.IsBol := true; 在设计时不能进行设置么?
if cyEdit.fIsBol then
ShowMessage('Yes')
else
ShowMessage('No');
if cyEdit.IsBol then
ShowMessage('Yes')
else
ShowMessage('No');
end;
end.
1、cyEdit的值永远为false
2、设计时不能进行定义么?