更新时间:2023-12-06 16:32:46
这是我使用全屏的代码。我创建了一个全屏
属性我的形式,当我需要,我将 this.FullScreen = TRUE;
Here is the code I use for fullscreen. I create a FullScreen
property for my form and when I need, I set this.FullScreen = true;
private bool fullScreen = false;
[DefaultValue(false)]
public bool FullScreen
{
get
{
return fullScreen;
}
set
{
fullScreen = value;
if (value)
{
//this.SuspendLayout();
this.WindowState = FormWindowState.Normal;
FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
WindowState = FormWindowState.Maximized;
//this.ResumeLayout(true);
}
else
{
this.Activate();
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
}
}
}