我有一个多文档父窗口,父窗口中有3个子窗口,
我现在在父窗口中有一个按钮是[关闭所有],希望点击以后可以关闭所有打开的子窗口,请问怎么做呢?还有一个[关闭]按钮,希望点击以后关闭最近打开的那个子窗口,请问怎么做呢?谢谢各位

解决方案 »

  1.   

    for i=forms.count-1 to 0 step -1
    if forms(i).name<>"多文档" then
    unload forms(i)
    end if
    next
      

  2.   

    Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
    Private Sub UnloadAllChildWnd()
    Dim f As Form
    For Each f In Forms
     If GetParent(f.hwnd) <> 0 Then Unload f
    NextEnd Sub
      

  3.   

    VB 我也不知道
    如果是C#
    用application.exit();