【问题标题】:How to apply a vcl style hook to a particular component of a form?如何将 vcl 样式挂钩应用于表单的特定组件?
【发布时间】:2012-08-22 18:58:37
【问题描述】:
【问题讨论】:
标签:
delphi
delphi-xe2
vcl-styles
【解决方案1】:
您可以为 TPageControl 组件使用插入器类
检查此示例
type
TPageControl = class(Vcl.ComCtrls.TPageControl);
TForm1 = class(TForm)
PageControl1: TPageControl;
...
...
然后在interposer类所在的同一个单元中注册vcl style hook
TStyleManager.Engine.RegisterStyleHook(TPageControl, TTabControlStyleHookBtnClose);
或者使用完全限定的类型名
TStyleManager.Engine.RegisterStyleHook(Unit1.TPageControl, TTabControlStyleHookBtnClose);