什么因素控制对话框按钮外观? [英] What factors control dialog button appearance?

查看:65
本文介绍了什么因素控制对话框按钮外观?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Windows对话框中UI元素(如按钮)外观的影响因素有点困惑。我的困惑出现在以下观察中:



1-我在我的系统上安装了visual studio 2010,当我创建一个MFC对话框时,.rc上的按钮有一个复杂的外观,略微圆角等。当我构建MFC应用程序时,相同的外观出现在生成的exe中。



2-现在我得到一个开发的应用程序在VC 6中,将其转换为新的vs 2010项目。当我打开.rc文件时,UI外观与上面描述的相同。但是当我构建并运行应用程序时,按钮的ui外观是旧的,不复杂的。



3-我在旧代码中包含了InitcommonControlEx(),并且没有任何改变。也许它与此无关。



我的问题是控制这个ui元素的外观和感觉?是否与清单文件有关,它指示应用程序应该使用哪个版本的Windows库?



如果是这样,我该如何更新旧的清单文件项目,以便我获得新的UI外观?

解决方案

请添加以下编译器指令以指定清单文件属性。



 #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 = '65 95b64144ccf1df'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(链接器,/ manifestdependency:\type ='win32'name ='Microsoft.Windows.Common-Controls'version ='6.0.0.0'processorArchitecture ='*'publicKeyToken ='6595b64144ccf1df'language ='*'\ )
#endif





Please请参阅msdn链接以更改视觉样式。

http://msdn.microsoft.com/en-us/library/windows/desktop/bb773175%28v=vs.85%29.aspx [ ^ ]


I am a little confused on what are the factors that contribute to the appearance of the UI elements (like buttons) on windows dialogs. My confusion appears out of the following observations:

1- I have visual studio 2010 installed on my system and when I create a MFC dialog , the buttons on the .rc have a sophisticated look , slightly rounded corners etc. when I build the MFC application same appearance comes in the resulting exe.

2- Now I get an application that is developed in VC 6, convert it to new vs 2010 project. When I open the .rc file the UI look is same as described above.but when I build and run the app , the ui look of the buttons is old , unsophisticated.

3- I include InitcommonControlEx() in the old code , and that changes nothing.Perhaps it is not related to this.

My question is what is controlling this look and feel of the ui elements? Is it something to do with the manifest file which directs which version of windows library the application should use?

if so, how can I update the manifest file of the old project , so that I get the new UI look and feel?

解决方案

Please add the following compiler directive to specify manifest file attributes.

#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



Please refer the msdn link to change the visual styles.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb773175%28v=vs.85%29.aspx[^]


这篇关于什么因素控制对话框按钮外观?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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