码迷,mamicode.com
首页 > 其他好文 > 详细

隔代无法继承

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

标签:tde   default   为什么   style   span   lookup   fun   code   http   

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;

 

隔代无法继承

标签:tde   default   为什么   style   span   lookup   fun   code   http   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!