vb.net 一个窗体在另一个窗体的容器内显示

前端之家收集整理的这篇文章主要介绍了vb.net 一个窗体在另一个窗体的容器内显示前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
    Private Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As IntPtr _,ByVal hWndNewParent As IntPtr) As Integer
    Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Integer,ByVal x As Integer,ByVal y _
                                                      As Integer,ByVal nWidth As Integer,ByVal nHeight _
                                                      As Integer,ByVal bRepaint As Integer) As Integer

    Public Shared mobjOpenForm As Form

    Public Shared Sub DisplayFrm(ByVal frm As Form)

        Try
            mobjOpenForm = frm
            SetParent(mobjOpenForm.Handle,FrmMain.PanDetail.Handle)
            mobjOpenForm.Visible = True
            'mobjOpenForm.WindowState = FormWindowState.Maximized
            'MoveWindow(mobjOpenForm.Handle.ToInt32,mobjOpenForm.Width,mobjOpenForm.Height,1)

        Catch ex As Exception

        End Try

    End Sub

    Public Shared Sub CloseFrm()

        Try
            mobjOpenForm.Close()

        Catch ex As Exception

        End Try

    End Sub
原文链接:https://www.f2er.com/vb/259580.html

猜你在找的VB相关文章