按钮样式更改为win2000 [英] Button Style changed to win2000

查看:101
本文介绍了按钮样式更改为win2000的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将PC从WinXp更改为Win7.但是我继续使用VS2005.
现在,一个旧项目(可以用VS2002创建)具有奇怪的行为.
所有的按钮/编辑样式都没有视觉效果,并且具有win2000的外观. (在XP上没有发生)
此图像说明了问题:
链接 [

I changed my pc from WinXp to Win7. But I''m continuing to use VS2005.
Now an old project (may be created with VS2002) have a strange behaviour.
All the button/edit style has no visual effect and it has the look of win2000. (On XP this was not happens)
This image explains the problem:
link[^]:confused:

The more strange thing is that if I run the application ouside VS the style are all ok, but when debugging they came back to win2000 style (both debug and release).

I create a new empty MDI-MFC application (like the original one) and then running into VS the styles are ok X| .
Searcing for differences into the 2 folders I found some differences in the project file. But I think not important details.
One strange thing is that in the new application is absolutely missing the manifest... can the problem be related to that file?:~

I found also any article that explain the problem... do you have any link to suggest to me? :doh:

Thanks

推荐答案

要获得xp外观,应用程序需要具有一个清单,以为您的应用程序指明这一点.您可能需要将其添加到资源中或将其放置在应用程序的目录中.

解释如下:
http://msdn.microsoft.com/en-us/library/aa289524% 28VS.71%29.aspx [ ^ ]

祝您好运!
To get the xp look the application would need to have a manifest that indicate this for your application. You would either need to add it in the resources or place it in the directory of the application.

It''s explained here:
http://msdn.microsoft.com/en-us/library/aa289524%28VS.71%29.aspx[^]

Good luck!


除了E.F. Nijboer已经写过的内容之外,请注意VS2002/2003和VS2005如何处理清单:

  • Visual Studio 2002/2003 上,当您创建新项目时,将创建扩展名为 .manifest 的文本文件并将其添加到解决方案中.要将其嵌入到资源中,应将其作为RT_MANIFEST资源类型添加到 .rc 文件中.
  • Visual Studio 2005 和更高版本上,当您创建新项目时,某些pragma被添加到您的stdafx.h文件中:
In addition to what E.F. Nijboer already wrote, be aware about how VS2002/2003 and VS2005 handle the manifest:


  • On Visual Studio 2002/2003, when you create a new project, a text file with extension .manifest is created and added to the solution. To embed it in te resources you should add it to your .rc file as an RT_MANIFEST resource type.
  • On Visual Studio 2005 and newer, when you create a new project, some pragmas are added to your stdafx.h file:
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif


稍后,清单工具(即 mt.exe )将使用这些信息来创建清单,并将其嵌入到可执行文件的资源中(在链接步骤之后). /li>


This informations are used later by the Manifest Tool (i.e. mt.exe) to create a manifest and embed it into the resources of the executable (after the linking step).


这篇关于按钮样式更改为win2000的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆