多屏情况下,设置窗口默认第二屏 无窗口显示

发布时间 2023-03-22 21:09:37作者: 智烨

// form1.cs
public Form1() { InitializeComponent(); //多屏显示的时候,设置窗口在那个屏幕显示 Screen[] sc; sc = Screen.AllScreens; this.StartPosition = FormStartPosition.Manual; this.Location = new Point(sc[1].Bounds.Left, sc[1].Bounds.Top); }
        private void Form1_Load(object sender, EventArgs e)
        {
            timer2.Start();
            this.FormBorderStyle = FormBorderStyle.None;
            this.WindowState = FormWindowState.Maximized;
        }