Private Sub CloseOpenForms 'create a copy of the collection of current open forms 'because the Application.OpenForms changes everytime we 'close an open form Dim OpenForms As FormCollection = Application.OpenForms For Each frm As Form In OpenForms 'check if current form is our MDI Parent 'if not then close it, otherwise skip it If Not frm.IsMdiContainer Then frm.Close() End If Next End Sub
The programmer's notebook is a reference for programmers. Here you can find code snippet's for VB.Net, C# .Net, WPF and many more...
Pages
How to close all open forms in your MDI Application in VB.Net
I have came across a situation lately where i needed to close all open forms in my MDI Application when a user clicks on the log-off button. Here's how i did it...
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment