我正在寻找有关以下问题的一些提示或解决方案。
我有一个在双屏环境中运行的 .NET 2.0 WinForm 对话框。工作区由 .NET Framework 设置以反射(reflect)主屏幕。我想将表单最大化到两个屏幕,但在单击“最大化按钮”后,对话框仅最大化到“事件”屏幕(事件我的意思是当前放置对话框的屏幕)。
我对边界解决方案不感兴趣,这可行,但是当单击“最大化”按钮时,它会强制对话框返回到 2 个屏幕之一。
如有任何帮助或提示,我将不胜感激。
最佳答案
这可能会迟到,但这里有一个简单的方法。它通过获取分辨率大小来设置表单的大小。然后放置表单,使其可见。
int screenLeft = SystemInformation.VirtualScreen.Left;
int screenTop = SystemInformation.VirtualScreen.Top;
int screenWidth = SystemInformation.VirtualScreen.Width;
int screenHeight = SystemInformation.VirtualScreen.Height;
this.Size = new System.Drawing.Size(screenWidth, screenHeight);
this.Location = new System.Drawing.Point(screenLeft, screenTop);
关于c# - 在两个屏幕上最大化表单(双屏幕监视器),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3361211/