Go Premium for a chance to win a PS4. Enter to Win


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
  • 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.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

916 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