设为首页 加入收藏

TOP

wpf dual monitor
2019-10-09 19:59:04 】 浏览:63
Tags:wpf dual monitor
public partial class App : System.Windows.Application
    {

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);           

            SetupWindows();
        }
         
        private void SetupWindows()
        {
            System.Windows.Forms.Screen mainScreen = Screen.AllScreens[0]; ;
            WinLeft leftWin = new WinLeft()
            {
                WindowStartupLocation = WindowStartupLocation.Manual,
                WindowState = System.Windows.WindowState.Normal,
                Left = mainScreen.WorkingArea.Left,
                Top = mainScreen.WorkingArea.Top,
                Width = mainScreen.WorkingArea.Width,
                Height = mainScreen.WorkingArea.Height
            };           

            System.Windows.Forms.Screen secondaryScreen = Screen.AllScreens[1];
            WinRight rightWin = new WinRight()
            {
                WindowStartupLocation = WindowStartupLocation.Manual,
                WindowState = System.Windows.WindowState.Normal,
                Left = secondaryScreen.WorkingArea.Left,
                Top = secondaryScreen.WorkingArea.Top,
                Width = secondaryScreen.WorkingArea.Width,
                Height = secondaryScreen.WorkingArea.Height
            };

           
            leftWin.Show();
            leftWin.WindowState = WindowState.Maximized;
            rightWin.Show();
            rightWin.WindowState = WindowState.Maximized;
            rightWin.Owner = leftWin;
        }
    }

 

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇.net Ajax与后台一般处理程序(ash.. 下一篇ServiceStack.Redis高效封装和简..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目