如何制作表格全屏的面板

时间:2014-02-11 08:59:51

标签: vb.net

我正在vb.net中开发一个电视调谐器应用程序,我的视频将在一个面板上播放,我希望该面板在点击一个按钮时变成全屏幕就可以在媒体播放器中看到??? / p>

1 个答案:

答案 0 :(得分:2)

Private sz As Size
Private pnt As Point

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
    Me.WindowState = FormWindowState.Maximized

    pnt = Panel1.Location
    sz = Panel1.Size

    Panel1.Parent = Me
    Panel1.BringToFront()
    Panel1.Location = Me.Location
    Panel1.Size = Me.Size
End Sub

并通过面板上的MouseDown事件恢复正常:

Private Sub Panel1_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown
    Me.FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable
    Me.WindowState = FormWindowState.Normal

    Panel1.Parent = GroupBox1
    Panel1.Location = pnt
    Panel1.Size = sz
    GroupBox1.BringToFront()
End Sub