ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

C# 将窗口显示在指定屏幕

2022-06-23 11:06:14  阅读:27  来源: 互联网

标签:count 窗口 Form C# Screen frm screens Frm2 屏幕


            Form Frm2 = new Form2();
            Frm2.Show();

            Screen[] screens = Screen.AllScreens;//获取当前所有显示屏
            int count = screens.Count();
            foreach (Form frm in Application.OpenForms)
            {
                if (frm is Form2)
                {
                    frm.StartPosition = FormStartPosition.Manual;
                    frm.Location = new Point(screens[count - 1].Bounds.Left, screens[count - 1].Bounds.Top);//将窗口显示在第二个显示屏
                    frm.WindowState = FormWindowState.Maximized;
                }
            }

 

标签:count,窗口,Form,C#,Screen,frm,screens,Frm2,屏幕
来源: https://www.cnblogs.com/blossomwei/p/16404269.html

专注分享技术,共同学习,共同进步。侵权联系[admin#icode9.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有