.net 您可以全屏运行 VB 应用程序吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8657991/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can you run a VB application in full-screen?
提问by GeekMasher
I just want to ask: How do you get an application, using Microsoft Visual Basic 2010 express, to run in full screen mode. You know what I mean, like a game would but an application.
我只是想问:您如何让使用 Microsoft Visual Basic 2010 express 的应用程序以全屏模式运行。你知道我的意思,就像游戏只是一个应用程序。
Is it possible? If not, tell me how and what I need to do it. Thanks.
是否可以?如果没有,请告诉我如何以及我需要做什么。谢谢。
回答by
In your Form_load add the following two lines:
在您的 Form_load 中添加以下两行:
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Me.WindowState = FormWindowState.Maximized
Obviously, you can place the code elsewhere than in form_load - and depending on your list of includes you may need more or less prepending.
显然,您可以将代码放在 form_load 之外的其他地方 - 根据您的包含列表,您可能需要更多或更少的前置。
回答by Isuru
set the WindowStateproperty to Maximized
将WindowState属性设置为Maximized
回答by betrice mpalanzi
The FormBorderStyleline is essential to show as full screen, so the top bar controls are not visible.
该FormBorderStyle行对于全屏显示至关重要,因此顶部栏控件不可见。
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Me.WindowState = FormWindowState.Maximized
End Sub

