与XP中的边框宽度相比,Windows7中的Windows窗体的边框宽度更大. [英] Border width of the windows form in Windows7 is bigger compared to the border width in XP.

查看:97
本文介绍了与XP中的边框宽度相比,Windows7中的Windows窗体的边框宽度更大.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个Windows窗体,其边框样式设置为可调整".当此应用程序在XP中运行时,它可以按预期方式运行,但是当在Widows7或Windows Vista中运行该应用程序时,其边框宽度比预期的要大得多,而这个额外的宽度是从Form的工作区获取的.

我想知道为什么在Vista和Windows7中会采用这种额外的宽度,以及如何限制宽度以使表格边框看起来类似于XP中所示的解决方案.

Hi ,

I have a windows forms whose border style is set to Sizable. When this app is run in XP it is working as expected , but when the same runs in Widows7 or Windows Vista its border width is much bigger than what is expected and this extra width is taken from the client area of my Form .

I would like to know why this extra width is taken in Vista and Windows7 , and what is the solution for restricting the width to make the form border look similar to what is shown in XP.

推荐答案



看看api调用GetSystemMetrics().您需要传递的索引是SM_CXFRAME.您可以通过Windows中的显示属性进行控制,以使窗口边框更宽或更细.在Vista/7中,边框变粗以强调半透明效果.

您可能还希望以不同的主题来测试您的应用,因为它们经常会改变边框的厚度.

谢谢,

迈克.
Hi,

Have a look at the api call GetSystemMetrics(). The index that you need to pass in is SM_CXFRAME. You can control this via the display properties within Windows, to give a wider or thinner border to your windows. In Vista/7 the border is thicker to emphasize the translucent effect.

You may also want to test your app in different themes too as these often change the border thickness.

Thanks,

Mike.


这篇关于与XP中的边框宽度相比,Windows7中的Windows窗体的边框宽度更大.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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