如题

解决方案 »

  1.   

    不要这么直接吗,会伤人家自尊心的!!! ^-^    见过人家用GetWindowThreadProcessId、GetParent、SetParent把记事本、计算器等程序作为自己的子窗体呢!
      

  2.   

    可以的啦。在工程窗体栏点右键添加MDI窗体,然后再选择现有的那个窗体(你要变成MDI的窗体),一键“确定”之后,OK>。
      

  3.   

    小虎说的不行,它会说已经exist了我用的的办法就是做一个MDIFROM ,然后把我已经现成的FORM 加进去
      

  4.   

    工程中加一个 MDIForm,设置需要变换 Form 的 MDIChild 属性为 True
      

  5.   

    Option ExplicitPrivate Notepad_OldParent&
    Private Notepad_Hwnd&'打开
    Private Sub mnuOpenNotepad_Click()
        Dim pid As Long
        Dim buf As String
        Dim buf_len As Long
        Dim styles As Long    pid = Shell("notepad.exe", vbNormalFocus)
        If pid = 0 Then
            MsgBox "Error starting program"
            Exit Sub
        End If    Notepad_Hwnd& = InstanceToWnd(pid)    Notepad_OldParent& = SetParent(Notepad_Hwnd&, Me.hwnd)    mnuOpenNotepad.Enabled = False
        mnuResNotepad.Enabled = True
    End Sub'释放
    Private Sub mnuResNotepad_Click()
        SetParent Notepad_Hwnd&, Notepad_OldParent&    mnuOpenNotepad.Enabled = True
        mnuResNotepad.Enabled = False
    End Sub
      

  6.   

    模块
    Option ExplicitPublic Const GW_HWNDNEXT = 2Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
    Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
    Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Long, ByVal lpWindowName As Long) As Long
    Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
    Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
    Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long' Return the window handle for an instance handle.
    Function InstanceToWnd(ByVal target_pid As Long) As Long
        Dim test_hwnd As Long
        Dim test_pid As Long
        Dim test_thread_id As Long    ' Get the first window handle.
        test_hwnd = FindWindow(ByVal 0&, ByVal 0&)    ' Loop until we find the target or we run out
        ' of windows.
        Do While test_hwnd <> 0
            ' See if this window has a parent. If not,
            ' it is a top-level window.
            If GetParent(test_hwnd) = 0 Then
                ' This is a top-level window. See if
                ' it has the target instance handle.
                test_thread_id = GetWindowThreadProcessId(test_hwnd, test_pid)            If test_pid = target_pid Then
                    ' This is the target.
                    InstanceToWnd = test_hwnd
                    Exit Do
                End If
            End If        ' Examine the next window.
            test_hwnd = GetWindow(test_hwnd, GW_HWNDNEXT)
        Loop
    End Function
      

  7.   

    呵呵!想得太复杂了!其实很简单,用写字板打开该窗体文件,把VB.Form替换成VB.MDIForm即可转化前备份一下。我用次法转过的,如有疑问分别用记事本打开一个普通窗体文件一个MDI窗体文件,一比较就明白了。