【问题标题】:Upgrade appearance of VS6 MFC dialog application to VS2008将 VS6 MFC 对话框应用程序外观升级到 VS2008
【发布时间】:2011-05-24 01:29:58
【问题描述】:

我正在将一个 VS6 MFC 对话框应用程序更新到 VS2008。更新代码很容易,但对话框仍然具有老式的 VS6 外观。例如,组框有方形边缘并且是深灰色的。而不是 VS2008 应用程序 Group Box 的圆角和浅灰色。

如何强制我的应用程序使用 VS2008 MFC 对话框应用程序更现代的外观?

【问题讨论】:

标签: visual-studio-2008 mfc


【解决方案1】:

一个新的 MFC 项目会将以下内容添加到 stdafx.h:

// Define manifest directives to match platform
#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_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

我还将以下内容添加到我的项目中,以明确链接到 UXTHEME.LIB,其中子类基本控件以添加主题支持:

#ifdef _UXTHEME_H_
#pragma message( "Including uxtheme.lib for linking" )
#pragma comment(lib, "uxtheme.lib")
#endif

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-07-03
    • 2010-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多