【问题标题】:C++ Builder XE - customizing TCategoryPanelC++ Builder XE - 自定义 TCategoryPanel
【发布时间】:2012-05-24 02:41:05
【问题描述】:

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

我需要做以下事情:

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

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

【问题讨论】:

    标签: components customization c++builder c++builder-xe


    【解决方案1】:

    我通过创建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;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多