问题描述
我有一个基于 MFC 的应用程序,它看起来太旧了,可能主题是原生窗口.我知道在创建新的 MFC 应用程序时,可以选择不同的视觉样式.
I have an MFC based application which looks too old, maybe the theme is Native windows. I know that while creating a new MFC application, there is option to select different visual styles.
我现在想选择不同的视觉风格,也许是 Windows 7.我该怎么做?
I want to select different Visual style now, maybe Windows 7. How can I do it?
编辑 1:应用程序是在 Visual Studio 2005 中编写的.因此外观和感觉太旧了.我已将其迁移到 Visual Studio 2015,但外观仍然相同.
Edit 1: The application is written in Visual Studio 2005. Hence the look and feel is too old. I have migrated it to Visual Studio 2015 but still the look is same.
推荐答案
在 stdafx.h 中有一些代码:
In stdafx.h there is some code:
#ifdef _UNICODE
#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
#endif
你确定是否有效?如果项目不是 UNICODE,只需注释 #ifdef _UNICODE(和他的对 #endif)以激活视觉样式...
are you sure if is working ? If the project aren't UNICODE, just comment #ifdef _UNICODE (and his pair #endif) in order to have visual style activated ...
这篇关于更改 MFC 应用程序的视觉样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!