다중 모니터 사용시 주 모니터 쪽에서 응용프로그램이 시작되며 Form이 열리는 것이 불편할 수 있어 사용.
private static void SetStartPosition(Form frm)
{
frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
System.Windows.Forms.Screen screen = System.Windows.Forms.Screen.FromPoint(System.Windows.Forms.Cursor.Position);
System.Drawing.Rectangle rectangle = screen.WorkingArea;
var d = screen.WorkingArea.Location;
frm.Left = d.X + (rectangle.Width / 2 - frm.Width / 2);
frm.Top = d.Y + (rectangle.Height / 2 - frm.Height / 2);
}
'.Net Framework Standard > WindowsApplication' 카테고리의 다른 글
고성능 CPU 머신에서 병렬 처리시 저성능 CPU 보다 느린 증상 처리 (0) | 2024.01.05 |
---|---|
ClickOnce - System.Security.SecurityException 오류 ( System.Threading.Thread.set_CurrentCulture) (0) | 2022.03.04 |
FormBoardStyle.None 일 때 Form의 이동 (0) | 2022.01.25 |
IIS 보안 적용시 ClickOnce 사용 - TLS (0) | 2017.08.02 |
Duplex Service 샘플 두가지 입니다. (0) | 2016.06.20 |