Net Core教程

C# Screen类实现多屏显示

本文主要是介绍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;

        }

 

这篇关于C# Screen类实现多屏显示的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!