Home >Backend Development >C++ >How Can I Make a WinForms App Truly Full-Screen and Hide the Taskbar?
WinForms application displays full screen and hides taskbar
For a WinForms application to achieve a true full-screen experience, not only the standard window borders need to be hidden, but also the taskbar needs to be hidden.
Hide taskbar
To hide the taskbar:
this.TopMost
to true
. this.FormBorderStyle
to FormBorderStyle.None
. this.WindowState
to FormWindowState.Maximized
. <code class="language-csharp">private void Form1_Load(object sender, EventArgs e) { this.TopMost = true; this.FormBorderStyle = FormBorderStyle.None; this.WindowState = FormWindowState.Maximized; }</code>
Auto-hide menu bar
To automatically hide the menu bar:
AutoSize
property to true
. Dock
attribute to DockStyle.Top
. MenuStrip_MouseLeave
event and set the Visible
attribute to false
. <code class="language-csharp">private void MenuStrip_MouseLeave(object sender, EventArgs e) { this.MenuStrip.Visible = false; }</code>
The above is the detailed content of How Can I Make a WinForms App Truly Full-Screen and Hide the Taskbar?. For more information, please follow other related articles on the PHP Chinese website!