问题描述
我有我试图让全屏幕(有点像什么呢VS在全屏模式下)WinForms应用程序。
I have a Winforms app that I am trying to make full screen (somewhat like what VS does in full screen mode).
目前我设置FormBorderStyle为None,为的WindowState最大化,这给我多一点空间,但它并没有在任务栏覆盖,如果它是可见的。
Currently I am setting FormBorderStyle to None and WindowState to maximized which gives me a little more space, but it doesn't cover over the taskbar if it is visible.
什么我需要做的使用空间,以及?
What do I need to do to use that space as well?
有关加分,是有什么我可以做,使我的MenuStrip自动隐藏放弃空间呢?
For bonus points, is there something I can do to make my MenuStrip autohide to give up that space as well?
推荐答案
要基本问题,下面会做的伎俩(隐藏任务栏)
To the base question, the following will do the trick (hiding the taskbar)
private void Form1_Load(object sender, EventArgs e)
{
this.TopMost = true;
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
}
不过,有趣的是,如果你掉最后两行的任务栏仍然可见。我认为,这些行动的顺序将是很难的属性窗口来控制。
But, interestingly, if you swap those last two lines the Taskbar remains visible. I think the sequence of these actions will be hard to control with the properties window.
这篇关于我如何做一个WinForms应用程序进入全屏模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!