TrzPageControl Tab colors

Viewing 3 reply threads
  • Author
    Posts
    • #2232
      Anonymous

        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

      • #2234
        Ray Konopka
        Keymaster

          Hi,

          What VCL Style are you using?

          Ray

        • #2236
          Anonymous

            I’m using the Auric theme.   Raize vs VCL tab color

             

            See “Pacs search” VCL   vs “Previous Reports” Raize tabs.

             

            Thanks

            A

          • #2261
            Ray Konopka
            Keymaster

              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

          Viewing 3 reply threads
          • You must be logged in to reply to this topic.