SIMIN Posted June 22, 2008 Posted June 22, 2008 Hi everyone, Does anyone know how can I close all forms on my application EXCEPT main / startup form? Something like this in VB6 ? Dim frm As Form For Each frm In Forms Unload frm Set frm = Nothing Next Quote
Administrators PlausiblyDamp Posted June 22, 2008 Administrators Posted June 22, 2008 Could you not have a collection of forms and simply add each form you open to it? To close them all you would simply loop over the collection and call the .Close method of each form in turn. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
roger_wgnr Posted June 23, 2008 Posted June 23, 2008 You can use something like this For Each FrmToClose As Form In Application.OpenForms If FrmToClose IsNot Me Then FrmToClose.Close() End If Next Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.