폼 전체화면으로 만들기.
첫번째 방법
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.WindowState = FormWindowState.Maximized;
두번째 방법
fullScrenn_bounds = Rectangle.Empty;
foreach (var screen in Screen.AllScreens)
{
fullScrenn_bounds = Rectangle.Union(fullScrenn_bounds, screen.Bounds);
}
this.ClientSize = new Size(fullScrenn_bounds.Width, fullScrenn_bounds.Height);
this.Location = new Point(fullScrenn_bounds.Left, fullScrenn_bounds.Top)
으로 하면 전체화면이 되긴하는데 듀얼모니터에서 제대로 되지 않는다.
StartPosition을 Manual로 바꾸고하니까 전체화면이 됨
this.StartPosition = FormStartPosition.Manual;
fullScrenn_bounds = Rectangle.Empty;
foreach (var screen in Screen.AllScreens)
{
fullScrenn_bounds = Rectangle.Union(fullScrenn_bounds, screen.Bounds);
}
this.ClientSize = new Size(fullScrenn_bounds.Width, fullScrenn_bounds.Height);
this.Location = new Point(fullScrenn_bounds.Left, fullScrenn_bounds.Top);'C#' 카테고리의 다른 글
| [C#] TextBox에 숫자만 입력받기 (0) | 2014.11.10 |
|---|---|
| C# Spy++ (0) | 2014.11.06 |
| C# 투명한 폼 만들기 (2) | 2014.11.04 |
| C# 폼 이동 코드 (0) | 2014.11.04 |
| C# 전역 마우스 후킹(hooking) 및 block (0) | 2014.11.03 |
테스트용 윈폼_FullScreen.zip
