C# Screen类实现多屏显示

private void ShowOnMonitor(int monitor, Window window)
        {
            window.WindowStyle = WindowStyle.None;
            window.WindowStartupLocation = WindowStartupLocation.Manual;

            System.Windows.Forms.Screen[] screens = System.Windows.Forms.Screen.AllScreens;

            window.Left = screens[monitor].Bounds.Left;
            window.Top = screens[monitor].Bounds.Top;
            //window.Width = screens[monitor].WorkingArea.Width;
            //window.Height = screens[monitor].WorkingArea.Height;
            window.Show();
            window.WindowState = WindowState.Maximized;

        }

 

posted @ 2021-11-17 18:47  攀登者123  阅读(662)  评论(0)    收藏  举报