我正在处理一个项目,我需要让表单填满整个屏幕
Me.Height = Screen.PrimaryScreen.Bounds.Height
Me.Width = Screen.PrimaryScreen.Bounds.Width
Me.FormBorderStyle = FormBorderStyle.None
Me.Location = New Point(Screen.AllScreens(0).Bounds.X,
Screen.AllScreens(0).Bounds.Y)
Me.Height = Screen.PrimaryScreen.Bounds.Height
Me.Width = Screen.PrimaryScreen.Bounds.Width
Me.FormBorderStyle = FormBorderStyle.None
这适用于在主屏幕的任何一个屏幕上填满整个屏幕,我的问题是在使用多个监视器时(我使用3)我如何获得屏幕表格,并在屏幕上全屏显示不只是跳到我的主屏幕?
没关系,我喝了一点咖啡......
Me.Height = Screen.FromControl(Me).Bounds.Height
Me.Width = Screen.FromControl(Me).Bounds.Width
Me.FormBorderStyle = FormBorderStyle.None
Me.Location = New Point(Screen.FromControl(Me).Bounds.X,
Screen.FromControl(Me).Bounds.Y)
Me.Height = Screen.FromControl(Me).Bounds.Height
Me.Width = Screen.FromControl(Me).Bounds.Width
Me.FormBorderStyle = FormBorderStyle.None
WinForm上有一个名为WindowState的属性。将此设置为最大化。表单将自动填充整个监视器。
Form1.WindowState = Maximized