Solved

Pagecontrol Tabsheets have recently changed from clBtnface to white

Posted on 2011-03-10
9
2,700 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
  • 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
 

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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:ewangoya
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
automatically logging in via bde delphi 3 54
Convert Jpg /PNG To GIF 5 103
LAN or WAN ? 11 63
Delphi: Connect to running MS Outlook 4 32
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now