Pagecontrol Tabsheets have recently changed from clBtnface to white

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.
salex319Asked:
Who is Participating?
 
MvanderKooijCommented:
My ques is that Delphi 2010 automaticly activates themes support. It is an application property in the project options.
0
 
jimyXCommented:
Have you checked whether it happens because of changed OS theme?

Also could you attach a snapshot of that Window please.
0
 
Emmanuel PASQUIERFreelance Project ManagerCommented:
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
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
salex319Author Commented:
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.

ThemeIDE.jpg
ThemeRunTime-ERT-chked.jpg
ThemeRunTime-ERT-unchked.jpg
0
 
Emmanuel PASQUIERFreelance Project ManagerCommented:
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)
0
 
salex319Author Commented:
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.
0
 
jimyXCommented:
I have read about an issue of white color in using TPageControl but I do not think it is your case here:
https://forums.embarcadero.com/thread.jspa?threadID=29815

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...".
0
 
Ephraim WangoyaCommented:

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
0
 
salex319Author Commented:
This answer gives me a workaround but no one actually answered the original question.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.