WinForm 窗口出现在靠屏幕左边中间或者右边中间

来源:互联网 发布:生物钟紊乱 知乎 编辑:程序博客网 时间:2024/05/02 04:44
            //设置窗体在屏幕左下角显示            int x = Screen.PrimaryScreen.WorkingArea.Left;            int y = 120;            this.Location = new Point(x, y);

            //窗口在右下角显示            int x = Screen.PrimaryScreen.WorkingArea.Right - this.Width;            int y = 120;            this.Location = new Point(x, y);

原创粉丝点击