delphi 控件设计期属性无法应用到运行期
例如自动尺寸是这样写的:
TNumEdit = class(TCustomControl)
private
FAutoSize: Boolean;
procedure SetAutoSize(const Value: Boolean);
published
property AutoSize: Boolean read FAutoSize write SetAutoSize default True;
end;
implementation
procedure TNumEdit.SetAutoSize(const Value: Boolean);
begin
if FAutoSize <> Value then
begin
FAutoSize := Value;
AdjustBounds;
end;
end;
end.
在设计器里面设置为true时,在运行的时候不起作用,要在运行的时候再设置一下才可以正常使用的。
[解决办法]
设置为false;
[解决办法]
default true拿掉