Solved

Pagecontrol Tabsheets have recently changed from clBtnface to white

Posted on 2011-03-10
9
2,853 Views
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.
0
Comment
Question by:salex319
[X]
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
9 Comments
 
LVL 24

Expert Comment

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

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

Expert Comment

by:epasquier
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
0
 
LVL 5

Accepted Solution

by:
MvanderKooij earned 500 total points
ID: 35107135
My ques is that Delphi 2010 automaticly activates themes support. It is an application property in the project options.
0
Independent Software Vendors: 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

by:salex319
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.

ThemeIDE.jpg
ThemeRunTime-ERT-chked.jpg
ThemeRunTime-ERT-unchked.jpg
0
 
LVL 25

Expert Comment

by:epasquier
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)
0
 

Author Comment

by:salex319
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.
0
 
LVL 24

Expert Comment

by:jimyX
ID: 35112165
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
 
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
0
 

Author Closing Comment

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

Featured Post

Industry Leaders: 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!

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 …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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