for i=forms.count-1 to 0 step -1 if forms(i).name<>"多文档" then unload forms(i) end if next
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
if forms(i).name<>"多文档" then
unload forms(i)
end if
next
Private Sub UnloadAllChildWnd()
Dim f As Form
For Each f In Forms
If GetParent(f.hwnd) <> 0 Then Unload f
NextEnd Sub
如果是C#
用application.exit();