将皮肤应用于MFC应用程序 [英] Applying skins to MFC applications
问题描述
大家好,
我们需要将自定义外观应用于MFC(vs 2010)应用程序.我在示例文件中看到了一个对象:CMFCVisualManager,该对象可用于应用皮肤对象,例如CMFCVisualManagerWindows7,也可用于 用于设置样式,例如:CMFCVisualManagerOffice2007 :: Office2007_ObsidianBlack
We have a requirement for applying a custom skin to our MFC (vs 2010) application. I saw in the sample files that there is an object: CMFCVisualManager which can be used for applying skin objects such as CMFCVisualManagerWindows7 and can also be used for setting styles such as: CMFCVisualManagerOffice2007::Office2007_ObsidianBlack
我的问题是:使用这些类或其他第三者皮肤解决方案是最佳实践吗?
My question is: Is it best practice to use these classes or other 3rd party skinning solutions?
CMFCVisualManager是否可以加载并应用已编译的Windows主题(.msstyles文件),或者我需要创建自己的可视管理器并覆盖用于创建皮肤的所有方法?
Can the CMFCVisualManager load and apply compiled windows theme (.msstyles file) or I need to create my own visual manager and override all methods for creating a skin?
希望我的问题很清楚.
非常感谢!
阿迪
推荐答案
您要做的工作取决于您现在如何使用MFC.
The work you have to do depends on how you are using MFC now.
MFC自Visual Studio 2008起就包含了新的功能和类,包括主题管理.使用这些新功能意味着要使用新的类(CMFC *).
MFC include new features and classes, including theme management, since Visual Studio 2008. Using these new features implies using new classes (CMFC*).
如果您的应用程序是使用MFC的新外观"创建的,则使用主题应该是刻板的.如果您使用的是旧样式", MFC应用程序,那么您应该看一下本演练:它解释了如何以旧样式"使用新的MFC功能. MFC应用程序
If your application has been created using MFC "new look", then using themes should be straitforward. If you are using "old style" MFC application, then you should have a look at this walkthrough: it explains how to use the new MFC features in a "old style" MFC application
http://msdn.microsoft.com/en-us/library/bb983935.aspx
MFC带有一些预定义的主题:Office 2007蓝色,黑色,Office 2003蓝色,黑色,Windows 7等.我认为创建自定义主题不是很容易,但是如果您覆盖它,则可以做到这一点. CMFCVisualManager创建皮肤的所有方法.我不 认为MFC使用.msstyles文件.
MFC come with a few predefined themes: Office 2007 blue, black, office 2003 blue, black, Windows 7, etc. I don't think it is very easy to create a custom theme but you can do it if you override all the methods of CMFCVisualManager to create a skin. I don't think MFC uses .msstyles files.
这篇关于将皮肤应用于MFC应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!