C++ Builder XE - 自定义 TCategoryPanel

问题描述 投票:0回答:1

这是我的应用程序屏幕截图的一部分:

enter image description here

我需要做以下事情:

  1. 删除分隔折叠面板的线
  2. 删除扩展面板底部边框上的线

我正在谈论的行由字符“!”突出显示在图像中。

components customization c++builder vcl c++builder-xe
1个回答
0
投票

我通过创建 TCategoryPanel 的正式后代类完成了第二个任务:

class MyCategoryPanel : public TCategoryPanel
{
public:
    __property BevelWidth;
};

目标是将 BevelWidth 属性的可见性从受保护更改为公共。现在我们可以将斜角宽度设置为零,例如这样(从父表单类调用代码):

int i;
for (i = 0; i < ComponentCount; i++) {
    TComponent *component = Components[i];
    TCategoryPanel *cat_panel = dynamic_cast<TCategoryPanel*>(component);
    if (cat_panel == NULL) {
        continue;
    }
    ((MyCategoryPanel*)cat_panel)->BevelWidth = 0;
}
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.