I have a main form on my application and I want to close all forms when I exit the main dialog.
How can I do that?

private Sub closeAllForms()
Dim i as Integer
for i = 0 to Forms.Count - 1
If Forms(i).Name <> "Wnd_Main" then
' close form(i)??
End If
next
End Sub