我有一张windows表格。我使用下面的代码设置它的大小。我想要的行为是让它占据主显示器的全宽和半高。
this.Location = new Point(0, 0);
this.WindowState = FormWindowState.Normal;
this.Size = new System.Drawing.Size(Screen.PrimaryScreen.Bounds.Width,Screen.PrimaryScreen.Bounds.Height / 2);问题是在正确的表单上有一个空格(它没有占据整个屏幕)。有没有人有任何建议来解释为什么?
谢谢
发布于 2012-08-14 21:14:01
尝试使用
Screen.PrimaryScreen.WorkingArea发布于 2021-09-23 02:41:57
有两种方法让它全屏显示:
// maximize the form
this.WindowState = FormWindowState.Maximized;或
// hide the border
this.FormBorderStyle = FormBorderStyle.None;您可以将它们放在一起尝试,但必须先隐藏边框,然后将窗口状态设置为notice the order。
https://stackoverflow.com/questions/11952865
复制相似问题