//활성화된 모니터를 불러온다
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
'.Net > C#' 카테고리의 다른 글
자식폼 끼리 데이터 전달(C# MyEventHandler 사용) (0) | 2020.12.29 |
---|---|
[DevExpress] 정렬전, 정렬후 GridControl 선택한 Row 인덱스 얻기 ( Get Row Index) (0) | 2020.12.29 |