Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Back color of mian menu in Windows XP

Status
Not open for further replies.

wangsx

Programmer
Mar 17, 2004
11
CA
Hi,

I compiled an application with C++ Builder 6 but the back color of the main menu is white when running it in Windows XP. How can I solve this problem? Thanks.

Regards,
 
This is a windows xp quirk.
Depending on the color scheme that you select, you appear to recieve different color pallets. For example the colors will be different depending on whether you select the default green, blue or silver themes.

I'm not sure why this is, the colors return to normal iff you select the classic theme.

 
Wings, Thanks. I tried change the theme it did work.
 
In the main form's object explorer, what have you set the color to be?


James P. Cottingham

There's no place like 127.0.0.1.
There's no place like 127.0.0.1.
 
Hi, James,
There is nowhere to set the color for TMainMenu. The color for MainForm is default clBtnFace.
 
[cannon]That blows my idea out the window.

James P. Cottingham

There's no place like 127.0.0.1.
There's no place like 127.0.0.1.
 
Howdy,

Could by chance the colors be changed in the window's appearances contols. If i am correct, that could cause the colors to change, but i would think it would have affects elsewhere too...

Just a thought,
onrdbandit
 
1. You can write a manifest for your app so that all its controls will have proper look, if a theme in the system is applied. If not all controls will have default look. The mainfest will be:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="x86"
name="MY_PROGRAM"
type="win32"
/>
<description>MY_PROGRAM_DESCRIPTION</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

For MY_PROGRAM enter the name of your program, for MY_PROGRAM_DESCRIPTION enter a short description, e.g.: FileManager

Write this in notepad and save as my_program.exe.manifest. The file has to be in the same directory as the app's executable.

2. To import a manifest into executable's resources do this:
- save the above mainfest as my_program.manifest (without .exe in the filename),
- also in notepad write this: 1 24 "my_Program.manifest"
- save it as an *.rc file, e.g.: manifest.rc, in the same directory as the my_program.manifest file,
- in Builder go to Project->Add to Project (Shift+F11) and add manifest.rc,
- compile and run.

Now your app should have the look according to the system's current visual style.
 
Onrdbandit,

Thanks for your help. I tried the method you mentioned. It really change the speed bar. But the main menu back color keeps the way as before.
As Wings said changing the xp scheme to standard will solve the problem.
Thanks again.

Shouxi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top