C#
C# 폼 FullScreen 전체화면으로 만들기
outshine90
2014. 11. 5. 11:19
폼 전체화면으로 만들기.
첫번째 방법
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);