.Net/Winforms,双显示器 - 无边框窗口 - 最大化不起作用 [英] .Net/Winforms, Dual monitor - Borderless Window - Maximizing doesn't work

查看:28
本文介绍了.Net/Winforms,双显示器 - 无边框窗口 - 最大化不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题没有在

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/fa521007-f317-48f1-9cdd-de2dbcb17aa8

(最后的帖子是我的帖子).StackOverflow 是更好的论坛,所以你能帮我 :)

(last posts are my posts). StackOverflow is better forum so could you help me :)

简要:

  • 双显示器配置,右侧主显示器分辨率较低,左侧显示器分辨率较高(低:1280x1024;高:1680x1050).最大化时,窗口大于显示器(仅适用于左显示器)
  • 处理无边框窗口基类
  • 最大化到实际客户区没有按预期工作.通过添加 WndProc 钩子和摆弄尺寸参数来解决.多显示器支持增加了一些问题,因为最大化似乎依赖于 MaxTrackSize 而不是 MaxSize.这似乎仅在主监视器小于第二监视器时发生

我在规范中发现的东西:

Something I found in specification:

http://msdn.microsoft.com/en-us/library/ms632605(v=VS.85).aspx

对于具有多个显示器的系统,ptMaxSize 和 ptMaxPosition成员描述最大化的大小和窗口在主监视器,即使窗口最终最大化到次要监视器.在这种情况下,窗口经理将这些值调整为补偿两者之间的差异主监视器和监视器显示窗口.因此,如果用户保持 ptMaxSize 不变,一个窗口在比主显示器大的显示器上显示器最大化到更大的显示器.

For systems with multiple monitors, the ptMaxSize and ptMaxPosition members describe the maximized size and position of the window on the primary monitor, even if the window ultimately maximizes onto a secondary monitor. In that case, the window manager adjusts these values to compensate for differences between the primary monitor and the monitor that displays the window. Thus, if the user leaves ptMaxSize untouched, a window on a monitor larger than the primary monitor maximizes to the size of the larger monitor.

因此,如果我在我的情况下理解正确,当任务栏放置在不将其隐藏在最大化窗口下的方式中时,不可能以更高分辨率在屏幕上最大化?

So if I understand correctly in my case it is impossible to maximize on screen with higher resolution when there is taskbar placed in the way not to hide it under maximized window?

干杯,jbk

推荐答案

这对我有用:

  1. FormBorderStyle 设置为 FixedSingle - 也可能适用于其他样式!= ,尚未测试...
  2. WindowState 设置为 FormWindowState.Maximized
  3. FormBorderStyle 重置为
  1. Set FormBorderStyle to FixedSingle - might also work with other styles != None, haven't tested that...
  2. Set WindowState to FormWindowState.Maximized
  3. Reset FormBorderStyle to None

至少,它适用于纯 WinForms 的东西,而无需求助于 WinAPI

At least, it works for pure WinForms stuff without resorting to WinAPI

这篇关于.Net/Winforms,双显示器 - 无边框窗口 - 最大化不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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