这是 Me.Top 的 .NET Framework 错误吗?

发布于 2025-01-01 07:40:53 字数 471 浏览 5 评论 0原文

我想我在设置或获取表单的 Me.Top 属性时发现了一个错误。 我使用的是 VS2010 VB.NET .NET Framework 4.0

我的显示器设置有点不寻常:

  1. Primary 1600 x 900

  2. 1680 x 1050

  3. 1680 x 1050

在此处输入图像描述

在 1 号监视器上,一切按预期运行。在监视器 2 或 3 上,如果我设置 Me.Top = 0,则表单将显示在距屏幕顶部 150 像素的位置,因此它认为它正在使用主监视器的分辨率。

我必须设置 Me.Top = -150 才能将表单置于屏幕顶部。

有人以前见过这个/知道修复或解决方法吗?

I think I have found a bug when setting or getting the Me.Top property of a form.
I am using VS2010 VB.NET .NET framework 4.0

My monitor setup is slightly unusual:

  1. Primary 1600 x 900

  2. 1680 x 1050

  3. 1680 x 1050

enter image description here

On monitor number 1 everything works as expected. On monitor 2 or 3 if I set Me.Top = 0 then the form appears 150 pixels from the top of the screen so it thinks that it is using the resolution of the primary monitor.

I have to set Me.Top = -150 to get the form to the top of the screen.

Has anyone seen this before / know of a fix or workaround?

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

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

发布评论

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

评论(1

梦归所梦 2025-01-08 07:40:53

这不是一个错误。坐标系与主屏幕相关。
在屏幕布局中,屏幕 2 和 3 的顶部边界比屏幕 1(主屏幕)“更高”。

如果要将窗口布局到屏幕的顶部边界,则应使用 屏幕类。

It's not a bug. The coordinate system is related to the primary screen.
In your layout of screens the screens 2 and 3 has their top bound "higher" than the screen 1 (the primary screen).

If you want layout your window to the top bound of the screen, you should use the Screen class.

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