Description:
I have a problem with the PageControl Component. All my Forms have a white background and the PageControl with a white background doesn't have a good appearance. The tab color is fixed and in some cases (i.e. using the Tabs style) the Tab background is fixed too.
I've noticed the PageControl is painted using a Painter so is it possible to define a custom painter to paint it?
Answer:
Yes, first you should create a descendant of the painter class (any descendant of an existing painter in the cxPCPainters.pas unit). Then override the following methods in it:
class function GetStyleID: TcxPCStyleID; - the style identifier
class function GetStyleName: TCaption; - the style name which will be displayed in the ObjectInspector
Finally, you should register your painter in the initialization section and unregister it in the finalization section as shown below:
Delphiuses
cxPCPaintersFactory;
...
initialization
RegisterPCPainterClass(TcxPCmyPainter);
finalization
UnregisterPCPainterClass(TcxPCmyPainter);
For more information please see the attached project.