Option ExplicitContoh penggunaan procedure di atas:
Public Sub CloseAllForm()
Dim frm As Form
For Each frm In Forms
Unload frm
Next
End Sub
Private Sub Form_Unload(Cancel As Integer)Demikian contoh kode VB6 untuk menutup seluruh form menggunakan for .. each. Semoga bermanfaat.
CloseAllForm
End Sub