窗口最大化时不遮挡任务栏

this.Size = Screen.PrimaryScreen.WorkingArea.Size;

//最大化最小化窗口

private void btnNormMax_Click(object sender, EventArgs e)
        {
            if (this.Size != Screen.PrimaryScreen.WorkingArea.Size)
            {
                this.Location = new Point(0, 0);
                this.Size = Screen.PrimaryScreen.WorkingArea.Size;
            }
            else
            {
                int winWidth = 990, winHeight = 693;
                this.Location = new Point((Screen.PrimaryScreen.WorkingArea.Size.Width- winWidth)/2, (Screen.PrimaryScreen.WorkingArea.Size.Height - winHeight) / 2);
                this.Size = new Size(winWidth, winHeight);
            }

        }

 

展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客
应支付0元
点击重新获取
扫码支付

支付成功即可阅读