仅在展开屏幕中打开Winform

时间:2017-01-05 14:41:41

标签: vb.net winforms

我已经在全屏模式下开发了一个应用程序,即:

Imports System.IO

Public Class FormMain
Private Sub FormMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
    Me.Location = New Point(0, 0)
    Me.Size = SystemInformation.PrimaryMonitorSize
    Me.StartPosition = FormStartPosition.WindowsDefaultLocation
End Sub

在没有菜单栏的情况下打开表单的行是Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None,这使我无法将应用程序拖放到展开的屏幕中。

我在办公室的计算机上启动应用程序,但目的是在我房间外的屏幕上显示。

谢谢

1 个答案:

答案 0 :(得分:1)

请改为尝试:

Me.Location = Screen.AllScreens(1).WorkingArea.Location
Me.StartPosition = FormStartPosition.Manual
Me.FormBorderStyle = FormBorderStyle.None
Me.WindowState = FormWindowState.Maximized

我还建议在设置之前检查AllScreens包含多个元素,以防此应用程序在只有1个屏幕的系统上运行。

相关问题