首页 > 其他 > 详细

隔代无法继承

时间:2018-06-21 01:21:49      阅读:285      评论:0      收藏:0      [点我收藏+]

https://www.cnblogs.com/onechen/p/6219144.html

提问:如下安装后的 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;

 

隔代无法继承

原文:https://www.cnblogs.com/marklove/p/9206791.html

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