如何全屏WinForm的窗体
![](http://images0.cnblogs.com/blog/23457/201306/04133659-ff57327cf2604cb2a6d61b0ef83d9f3f.gif)
'如果不把Border设为None,则无法隐藏Windows的开始任务栏
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Me.WindowState = FormWindowState.Maximized
'如果不允许运行其他程序,则可设为True,屏蔽其他窗体的显示
'但必须确保自身所有的窗体的TopMost除了子窗体外都要设置为true,否则也同样会被屏蔽
Me.TopMost = True
![](http://images0.cnblogs.com/blog/23457/201306/04133700-c6fa4161a909497c83f0aa755071c641.gif)
![](http://images0.cnblogs.com/blog/23457/201306/04133700-c4542c1bdff74f78aaff0974f3c1bfa6.png)
但通过代码设置
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
刚刚好可以把第一个标题栏隐藏掉,如不从OfficeForm继承,则会把仅有的一个隐藏掉,使窗体显示不正常
![](http://images0.cnblogs.com/blog/23457/201306/04133700-c6fa4161a909497c83f0aa755071c641.gif)
d3dpp.Windowed = false;
d3dpp.EnableAutoDepthStencil = true;
d3dpp.AutoDepthStencilFormat = DepthFormat.D16;
d3dpp.SwapEffect = SwapEffect.Discard;
d3dpp.BackBufferWidth = 640;
d3dpp.BackBufferHeight = 480;
d3dpp.BackBufferFormat = Format.X8R8G8B8;
d3dpp.PresentationInterval = PresentInterval.Immediate;