首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

delphi 控件设计期属性无法应用到运行期,该如何处理

2012-06-08 
delphi 控件设计期属性无法应用到运行期例如自动尺寸是这样写的:TNumEdit class(TCustomControl)private

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拿掉

热点排行