.Net/C#
멀티(듀얼) 모니터 사용시 서브 모니터에 Form 출력
라봉투
2021. 6. 1. 09:37
//활성화된 모니터를 불러온다
Screen[] screens = Screen.AllScreens;
public Form1()
{
InitializeComponent();
// 듀얼 모니터 사용시 서브 모니터에 폼 출력
if (screens.Length > 1)
{
GetCurrendMonitor();
}
}
#region 듀얼 모니터 사용시 서브 모니터에 폼 출력 코드
private void GetCurrendMonitor()
{ this.Left = screens[1].Bounds.Width;
this.Top = screens[1].Bounds.Height;
this.StartPosition = FormStartPosition.CenterScreen;
Point p = new Point(screens[1].Bounds.Location.X, screens[1].Bounds.Location.Y);
this.Location = p;
}
#endregion