Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Pagecontrol Tabsheets have recently changed from clBtnface to white

Posted on 2011-03-10
Medium Priority
Last Modified: 2012-05-11
I have been using Pagecontrols in a number of apps for some time. Recently I went to create a new app and I added a pagecontrol and a couple of tabsheets and the tabsheets backgrounds were white instead of gray. I switched over to one of my previous apps to see what I might have done differently and those tabsheet backgrounds are now white too. I've been searching for why this has happened and and I see solutions that involve a lot of ownerdraw complexity and they all seem to date from before 2006. I am using Delphi 2010 in Windows 7 and this hasn't changed recently. So I'm at a complete loss for what has happened to my system to account for this strange behavior. It can't be neccessary to ownerdraw the background because I wasn't doing so a week ago and everything was fine.
Question by:salex319
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
LVL 24

Expert Comment

ID: 35104978
Have you checked whether it happens because of changed OS theme?

Also could you attach a snapshot of that Window please.
LVL 25

Expert Comment

ID: 35106145
clBtnFace is a system color that can be whatever real color, so please check :
1) that the color property of the tabsheet/tab is still clBtnFace
2) that you don't have a theme activated, a skiner/styler component or something like that on your system
3) what happens if you run your executable in another workstation (XP for example)

please provide snapshots of your application under your system and a XP system

Accepted Solution

MvanderKooij earned 1500 total points
ID: 35107135
My ques is that Delphi 2010 automaticly activates themes support. It is an application property in the project options.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 35109978
MvanderKooij led me to an immediate workable solution. I unchecked the "Enable Runtime Themes" in Options | Application and the runtime appears the way I want it. I have never before done anything with that option and it defaults to set so this doesn't explain what has happened.

I am still confused because I haven't changed themes on my computer recently (except this morning) and this issue cropped up just in the last few days. This morning I played around with various themes and discovered that the Windows Classic theme results in the IDE showing the gray background but all others show the white background. I haven't ever used Windows Classic because it just doesn't look very good.

So I can now get a runtime that looks acceptable but I still don't know why the IDE view has changed. I would like the IDE to look like the runtime image w/o changing to Windows Classic theme. If anyone can shed any light on this I will split points. Thanks.

LVL 25

Expert Comment

ID: 35110757
activation of the themes is an application parameter, therefore in delphi, it will be applied by windows on all projects forms that you open in the IDE. So if you want to force your application to not use themes, you will have to imagine what it can look without themes, while editing your interface WITH the themes.
That is a major pain, pretty much the same when with older Delphi versions you wanted to do the opposite : creating an application that looks good on themed systems, while editing with an old Delphi that wasn't theme-aware.
That cannot be helped, and in the end you will most certainly do what most developpers did : cease to fight it and develop applications that will look good WITH themes, and only after try to fix whatever big unhappy looks some details may have on older systems.
You can play with panels to force some background colors, for example, when some components do not have a color property (like TabSheets)

Author Comment

ID: 35111422
Based on my experimenting with the themes available on my system the default behavior for a tabsheet is to have a white background. So if I just live with themes my apps would look like the second image above. But surely no one thinks that looks good do they? I think it looks very odd. It looks much better with a gray background to me. So I have a choice of living with themes or I have to use one of several approaches to defeating the theme behavior. The simplest of these approaches is to uncheck the "Enable Runtime Themes" option.

Perhaps I'm using the PageControl is some unusual way. I can't think of a common windows app with a PageControl component so I could see what that looks like.

Still up until a few days ago my tabsheets had a gray background in both the IDE and the runtime app w/o doing anything and I sure wish I could figure out why that changed.
LVL 24

Expert Comment

ID: 35112165
I have read about an issue of white color in using TPageControl but I do not think it is your case here:

You may try your application in different OS, because if that is the effect of the theme then it's normal, since the theme is an option for users to select if they like the changes it makes.
If you are not able to test in different environment then you can generate a sample exe showing the tabsheet with the white background and attach it here (zipped).

Also to make sure it's a general thing and it's applied on all the other SW, you can check any other SW such as MS Excel main menu -> Tools -> Options (2003 and older) or Delphi itself from the main menu -> Search -> "find in files...".
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 35119105

On the contrary, the Gray Background looks very odd. It looks like an old windows 3.1 application.

Using themes is pretty good and ensures your application retains a modern look be it in XP, Vista or Windows 7

You can alternatively get third party component pack like DevExpress which lets you customize the Page Control to your liking

Author Closing Comment

ID: 35173384
This answer gives me a workaround but no one actually answered the original question.

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question