Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8421535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:10:38+00:00 2026-06-10T03:10:38+00:00

In a Delphi 2010 application with themes enabled I have two TPageControls (one inside

  • 0

In a Delphi 2010 application with themes enabled I have two TPageControls (one inside the other) in a Form with a clMoneyGreen Background:

enter image description here

The outer page control correctly draw its background with the color of the parent component, the inner page control however draw its background with clBtnFace (red ellipsis in the image) instead of its parent control (TTabSheet)’s white. Is there a way to fix this without returning the page control to its windows classic appearance (lose windows theme)?

All fixes that I’ve found in Google and here on Stack Overflow involves OwnerDraw which make the page control lose its theming.

I have tried creating new page control component inherited from TPageControl with a method to handle the WM_ERASEBKGND windows message:

procedure TMyPageControl.WMEraseBkGnd(var Msg: TWMEraseBkGnd);
begin
  if Parent is TCustomPageControl then
  begin
    Brush.Color := clWhite;
    Windows.FillRect(Msg.dc, ClientRect, Brush.Handle);
    Msg.Result := 1;
  end
  else
    inherited;
end;

It paints the background white but some other method called after WM_ERASEBKGND (I’m guessing TWinControl’s WM_PAINT method) repaints gray over the white background.

Note: I’m researching this because I’m implementing theming on a large application ported from Delphi 7, that’s why I’m trying to solve this problem through a derived component: I can easily search and replace all the 207 TPageControl occurrences with my new class, but placing panels behind some of them would require way more time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T03:10:39+00:00Added an answer on June 10, 2026 at 3:10 am

    That’s a known bug in Delphi 2010. You can work around it by adding a panel that is a child of the outermost tabsheet, and is the parent of the inner page control.

    I’ve no idea why this fixes the problem. I only discovered the workaround myself because I noticed that in my app, the only nested tab/page controls that rendered properly were those with a panel suitably interposed.

    If I recall correctly, the defect is not present in the latest Delphi versions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written an application in Delphi 2010 that imports data from one database
My application is written using : Embarcadero Delphi 2010 I have a form named
In Delphi 2010, I have placed 2 radio groups onto a form then added
I have a media application (written in Delphi 2010 but I am not sure
Lets say I have an intraweb application (written in Delphi 2010) with an iwEdit
I have this simple console application in Delphi 2010 and I would like it
I have updated an application from Delphi 2007 to Delphi 2010, everything went fine,
We have an application server developed with Delphi 2010 and Indy 10. This server
I am writing a Delphi 2010 application. It has many files, two of which
We have an application written in Delphi 2010 which connects to SQL Server Database.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.