首页 > 其他 > 详细

[问题] Firemonkey 控件继承后无法显示(空白)

时间:2016-12-25 11:41:00      阅读:202      评论:0      收藏:0      [点我收藏+]

提问:如下安装后的 TMyPanel 能在设计期时正常显示,但 TMyPanel2 在设计期时是白板,不能正常看到,为什么?

TMyPanel = class(TPanel)
end;

TMyCustomPanel = class(TPanel)

TMyPanel2 = class(TMyCustomPanel)
end;

RegisterComponent(Test, [TMyPanel, TMyPanel2]);

可能:是隔代无法继承 Style 造成的,改成如下就可以了:

TMyPanel = class(TPanel)
end;

TMyCustomPanel = class(TPanel)
end;

TMyPanel2 = class(TMyCustomPanel)
  protected
    function GetDefaultStyleLookupName: string; override;
end;

function TMyPanel2.GetDefaultStyleLookupName: string;
begin
  Result := panelstyle;
end;

ps. 这里 QQ 群里的问题,记录一下。

[问题] Firemonkey 控件继承后无法显示(空白)

原文:http://www.cnblogs.com/onechen/p/6219144.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!