简体   繁体   English

当断开第二台显示器的连接时,我的全屏应用程序会被任务栏“覆盖”

[英]When disconnecting a second monitor, my fullscreen app gets “covered” by the taskbar

I have a .Net 4 WinForms application with the following properties on my MainForm : 我的MainForm上有一个.Net 4 WinForms应用程序,具有以下属性:

  • FormBorderStyle = None FormBorderStyle =无
  • WindowState = Maximized WindowState =最大化

It works as expected and covers the entire screen. 它可以按预期工作并覆盖整个屏幕。 However, if a second monitor is disconnected while the application is open, the screen goes black while Windows is "removing" it, and then when the screen comes back, the application is resized so that it fits above the taskbar. 但是,如果在打开应用程序时断开了第二个监视器的连接,则Windows在“移除”它时屏幕变黑,然后,当屏幕返回时,将调整应用程序的大小,使其适合任务栏上方。 I want the application to always be fullscreen and on top. 我希望该应用程序始终处于全屏状态。 Ideas? 想法?

也许您应该在MainForm的onFocus事件中使用WindowState = Maximized

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM