H
Henry Jones
I have a project that has 5 or 6 forms.
VB.NET VS 2005
In the FormClosing Event of each form I have the following code:
If Not IsNothing(frmA) Or Not frmA.IsDisposed Then frmA.Close()
If Not IsNothing(frmB) Or Not frmB.IsDisposed Then frmB.Close()
If Not IsNothing(frmC) Or Not frmC.IsDisposed Then frmC.Close()
If Not IsNothing(frmD) Or Not frmD.IsDisposed Then frmD.Close()
Me.Dispose()
In Form B I have to remove the: If Not IsNothing(frmB) Or Not
frmB.IsDisposed Then frmB.Close()
In Form C I have to remove the: If Not IsNothing(frmC) Or Not
frmC.IsDisposed Then frmC.Close()
etc.... Is there a way to iterate through all the forms in the FormClosing
event to make sure everything is closed before ending the application?
Thanks
VB.NET VS 2005
In the FormClosing Event of each form I have the following code:
If Not IsNothing(frmA) Or Not frmA.IsDisposed Then frmA.Close()
If Not IsNothing(frmB) Or Not frmB.IsDisposed Then frmB.Close()
If Not IsNothing(frmC) Or Not frmC.IsDisposed Then frmC.Close()
If Not IsNothing(frmD) Or Not frmD.IsDisposed Then frmD.Close()
Me.Dispose()
In Form B I have to remove the: If Not IsNothing(frmB) Or Not
frmB.IsDisposed Then frmB.Close()
In Form C I have to remove the: If Not IsNothing(frmC) Or Not
frmC.IsDisposed Then frmC.Close()
etc.... Is there a way to iterate through all the forms in the FormClosing
event to make sure everything is closed before ending the application?
Thanks