Home › Forums › Konopka Signature VCL Controls (formerly Raize Components) › TrzPageControl Tab colors
Tagged: trzpagecontrol tab color
- This topic has 3 replies, 2 voices, and was last updated 2020-11-07 at 4:27 pm by Ray Konopka.
-
AuthorPosts
-
-
October 20, 2020 at 3:29 pm #2232Anonymous
Using Delphi 10.2.3, I’m using the VCL theme on an application and when I use the TrzPageControl the Tab background and text is inverted from the standard VCL TPageControl Tabs. I can’t locate the setting to correct it so it is the same as the VCL.
Thanks in advance.
A
-
October 20, 2020 at 11:10 pm #2234
Hi,
What VCL Style are you using?
Ray
-
October 21, 2020 at 8:19 am #2236Anonymous
I’m using the Auric theme.
See “Pacs search” VCL vs “Previous Reports” Raize tabs.
Thanks
A
-
November 7, 2020 at 4:27 pm #2261
Hi,
I apologize for the long delay. Because of the custom styles of tabs that are supported by the TRzPageControl and TRzTabControl, the style entries cannot be used directly. As such, the controls use “style appropriate” colors. In the case of the Auric style, the difference is more pronounced.
However, the TRzPageControl does give you lots of flexibility when it comes to the display. For example, even with VCL Styles active, you can write event handlers for the various OnPaint*** events of TRzPageControl and TRzTabSheet to customize the appearance.
For example, write the following event handlers for the TRzPageControl:
OnPaintCardBackground:
procedure TForm2.RzPageControl1PaintCardBackground(Sender: TObject; ACanvas: TCanvas; ARow: Integer; const ARect: TRect; var Handled: Boolean); begin ACanvas.Brush.Color := cl3DDkShadow; ACanvas.FillRect( ARect ); Handled := True; end;
OnPaintTabBackground:
procedure TForm2.RzPageControl1PaintTabBackground(Sender: TObject; ACanvas: TCanvas; ATabIndex: Integer; const ARect: TRect; var Handled: Boolean); begin ACanvas.Brush.Color := cl3DDkShadow; ACanvas.FillRect( ARect ); Handled := True; end;
And create a new event handler for the OnPaintBackground even for each TRzTabSheet instance in the page control. You can assign all tab sheets to use the same event handler.
OnPaintBackground:
procedure TForm2.TabSheetPaintBackground(Sender: TObject; ACanvas: TCanvas; const ARect: TRect; var Handled: Boolean); begin ACanvas.Brush.Color := cl3DDkShadow; ACanvas.FillRect( ARect ); Handled := True; end;
This will give you an appearance that will be very close to the standard TPageControl and still let you use all the tab styles of TRzPageControl.
Ray
-
-
AuthorPosts
- You must be logged in to reply to this topic.