C++ Builder XE - customizing TCategoryPanel

536 views Asked by At

This is part of screenshot of my application:

enter image description here

I need to do following things:

  1. remove lines separating collapsed panels
  2. remove line on bottom border of expanded panel

The lines I am talking about are highlighted by character '!' in image.

1

There are 1 answers

0
truthseeker On

I accomplished the second task by creating formal descendent class of TCategoryPanel:

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

The goal is to change visibility of BevelWidth property from protected to public. Now we can set bevel width to zero for example like this (code is called from parent form class):

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;
}