怎样在控件里添加Font属性?? 没有做过,试一试在FFont.Assign (value);后面加一句Invalidate;乱猜的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 procedure TMycomponent.SetFont(value:Tfont);begin inherited SetFont(Value); if FFont<>value then FFont.Assign (value);end; 有个疑问: 你的FFont创建了没有? TFont 是一个对象,不能象整形一样声明后就可以直接用了 你得在你的TMyComponent的Contructor Create里面创建它, 并且还得在 Destructor Destroy 方法里面 释放它。 Contructor TMyComponent.Create; begin inherited; FFont := TFont.Create; <...> end; Destructor TMyComponent.Destroy; begin <...> FFont.Free; inherited; end; 补充一点: 上面例子的 Create 的参数个数可能不对,但是最主要的是 不要忘了这一句 FFont := TFont.Create。 Musicwind(吾爱是Yaya!) 是对的。 delphi 查找进程出错 怎样执行了一个方法后,令程序先等待一段时间,再执行下一个方法 关于Image控件的单击事件和双击事件 在线等待-100分 我不想让Listbox得焦点时有虚线框!怎么办呢? 急问serverSocket收到空包的问题 web开发的(InternetExpress)错误!(Delphi6) 使用事务的高手请进,这是怎么回事 请问delphi中怎样读出指定目录下的xml文件? 探讨关于客户端调用服务器的问题,欢迎高手执教。 请进来帮我看看这段代码 Adoquery问题?? RAR自解压文件解密!
begin
inherited SetFont(Value);
if FFont<>value then
FFont.Assign (value);
end;
你的FFont创建了没有?
TFont 是一个对象,不能象整形一样声明后就可以直接用了
你得在你的TMyComponent的Contructor Create里面创建它,
并且还得在 Destructor Destroy 方法里面 释放它。
Contructor TMyComponent.Create;
begin
inherited;
FFont := TFont.Create;
<...>
end;
Destructor TMyComponent.Destroy;
begin
<...>
FFont.Free;
inherited;
end;
上面例子的 Create 的参数个数可能不对,但是最主要的是
不要忘了这一句 FFont := TFont.Create。