Vista 和 Windows 7 边框截断表单内容

发布于 2024-08-14 10:59:25 字数 410 浏览 2 评论 0原文

Windows 7 和 Vista 上的表单比 XP 上的表单边框更粗。因此,一些跨越表单整个高度或宽度的内容将被剪掉。有没有一种简单的方法可以解决此问题,或者是否需要调整我的应用程序的所有表单的大小以适应此问题?

更新:这似乎是表单大小的错误,而不是导致问题的边框。请参阅以下图片的示例。请注意控件如何在右上角具有正确的位置,但它们在 Windows 7 中到达每个窗体,而在 XP 中保留边框。相同的代码用于调整控件的大小和位置。

XP 中的表单如下所示: 替代文本 http://img504.yfrog.com/img504/1328/bordersxp.png< /a>

Forms on Windows 7 and Vista have thicker borders than those of XP. As a result, some content that spans the entire height or width of a form will be cut off. Is there a simple way to fix this, or do all the forms of my application need to be resized to accommodate for this?

Update: It appears to be the fault of the form size and not the borders that are causing the problem. See the following images for an example. Notice how the controls have the correct location at the top-right corners, but they reach the each of the form in Windows 7 while a border is retained in XP. The same code is used to resize and position the controls.

Here's what a form looks like in XP:
alt text http://img504.yfrog.com/img504/1328/bordersxp.png

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寻找一个思念的角度 2024-08-21 10:59:25

您应该以编程方式修复表单的大小,以确保客户端大小足以容纳所有内容。您可以轻松计算表单当前大小和客户端大小之间的差异,并适当增加/减少量。

您可能想在 Form_Load 中执行此操作。

在 VB6 中,客户端尺寸和宽度被称为表单的 ScaleWidth 和 ScaleHeight。设置这些值只会扰乱缩放,而不是调整表单大小,因此您必须进行计算,以便可以设置正常的宽度和高度属性。

BorderSize = Me.Width - Me.ScaleWidth
Me.Width = BorderSize + CorrectScaleWidth
//Same for height!

You should fix the size of the form programatically, to make sure the client size is big enough to fit everything. You can easily calculate the difference between the current size and client size of the form, and increase/decrease by the right amount.

You probably want to perform this inside Form_Load.

In VB6, the client size and width are referred to as ScaleWidth and ScaleHeight for forms. Setting these values just messes up the scaling, rather than resizing the form, so you instead have to do calculations so you can set the normal Width and Height properties.

BorderSize = Me.Width - Me.ScaleWidth
Me.Width = BorderSize + CorrectScaleWidth
//Same for height!
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文