B
Bright
Unregistered / Unconfirmed
GUEST, unregistred user!
程序如下:
TSomeClass = class(TCustomListBox)
private
FMargeSize: Integer
procedure SetMargeSize(const Value: Integer);
...
public
...
constructor Create; override;
...
property MargeSize: Integer read FMargeSize write SetMargeSize stored True default 2;
end;
constructor TSomeClass.Create;
begin
FMargeSize := 2; // ***
end;
procedure TSomeClass.SetMargeSize(const Value: Integer);
begin
if Value <> FMargeSize then begin
FMargeSize := Value;
Repaint;
end;
end;
如果不加上***一句,属性MargeSize缺省为0,而且在属性编辑器中修改的值无法保存,不知为什么?
TSomeClass = class(TCustomListBox)
private
FMargeSize: Integer
procedure SetMargeSize(const Value: Integer);
...
public
...
constructor Create; override;
...
property MargeSize: Integer read FMargeSize write SetMargeSize stored True default 2;
end;
constructor TSomeClass.Create;
begin
FMargeSize := 2; // ***
end;
procedure TSomeClass.SetMargeSize(const Value: Integer);
begin
if Value <> FMargeSize then begin
FMargeSize := Value;
Repaint;
end;
end;
如果不加上***一句,属性MargeSize缺省为0,而且在属性编辑器中修改的值无法保存,不知为什么?