在所有操作系统版本中应用相同的外观 [英] Apply Same Look and Feel in all operating system version

查看:91
本文介绍了在所有操作系统版本中应用相同的外观的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计了一个基于MFC Dialogue的应用程序,它在我的桌面上看起来非常好,但在我的朋友笔记本电脑上看起来非常好!

所以我的问题是我应该拥有它的'外观和感觉将与操作系统版本iewin-xp或win-7相同????

I design one MFC Dialogue based application,it looks on my desktop very good,but on my friends laptop it looks very weired!
So my question is what I should have for it''s look and feel will be same as that operating system version i.e.win-xp or win-7????

推荐答案

如果您希望您的应用程序遵循以下风格:它上面安装的每台PC都需要查看主题。 Themes API将允许您在运行时检查用户首选项,并允许您的控件适合其他用户应用程序。您还需要确保使用最多数据Common Controls库并使用正确的设置调用InitCommonControls,以便为较新版本的Windows启用额外的外观。显然,如果您希望自己的应用看起来像Windows7应用,则需要在Windows7上定位构建。如果您的构建目标是XP,那么它通常只使用XP API,没有Windows 7的改进,即使它在Windows 7上运行,所以它看起来像一个旧的应用程序。

没有什么可以阻止你有不同的构建对于不同版本的Windows虽然可以利用最新的东西。



如果你希望你的应用程序看起来完全一样,那么你可能已经出局了幸运的是你可能会尝试使用Qt框架而不是MFC重写它。 Qt将为您提供更多的外观设置控制,以便在任何地方都能完全相同。然而,这是一个陡峭的学习曲线。
If you want your application to follow the style of each PC it''s installed on you need to look into Themes. The Themes API will let you examine the users preferences at runtime and allow your Controls to fit in with the rest of the users applications. You also need to make sure you''re using an up to data Common Controls library and call InitCommonControls with the correct settings to enable extra look and feel for newer versions of Windows. Also obviously you need to target your build at Windows7 if you want your app to look like a Windows7 app. If your build targets XP then it will general only use XP APIs, no Windows 7 improvements, even when it runs on Windows 7 so it will look like an old App.
Nothing to stop you having different builds for different versions of Windows though to take advantage of the latest stuff.

If you want your application to look exactly the same wherever it runs then you''re probably out of luck but you might try rewriting it using the Qt framework rather than MFC. Qt will give you more control over appearance settings with a view to gettin exactly the same everywhere. It''s a steep learning curve though.


这篇关于在所有操作系统版本中应用相同的外观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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