C#桌面上有两个窗口,右边有一个窗口 - 全屏幕较小

时间:2017-09-30 09:26:26

标签: c# winforms

我在C#中创建桌面应用程序。我需要与右侧的image相同的固定窗口,而另一个窗口的最大化模式中的大小为width = fullwidth - myWindow。

你是如何做到的?

我尝试了下一个代码,它运行良好,但另一个修复是全屏,我的应用程序在顶部。我需要Windows全屏状态作为全宽 - mywindow。

StartPosition = FormStartPosition.Manual;
    foreach (var scrn in Screen.AllScreens) {
        if (scrn.Bounds.Contains(Location)) {
            Height = scrn.WorkingArea.Height;
            Location = new Point(scrn.Bounds.Right - Width, scrn.Bounds.Top);
            return;
        }
    }

0 个答案:

没有答案
相关问题