Hi All,
I need some guidance here...How does one close or unload all open forms in VB.Net. Can someone please help me out in this regard?
Thanks very much.
i may try that out but this is the warning issued in msdn under application.exit() method
CAUTION The Form.Closed and Form.Closing events are not raised when the Application.Exit method is called to exit your application. If you have validation code in either of these events that must be executed, you should call the Form.Close method for each open form individually before calling the Exit method.
CAUTION The Form.Closed and Form.Closing events are not raised when the Application.Exit method is called to exit your application. If you have validation code in either of these events that must be executed, you should call the Form.Close method for each open form individually before calling the Exit method.
If you're using .NET 2.0 then that's not the case anymore. Application.Exit() raises the Form.Closing events.
If you're using .NET 2.0 then that's not the case anymore. Application.Exit() raises the Form.Closing events.
Application.Exit() causes all the dialogs to get closed. but, It creates some problems in my test applicatin. is there anyother way to close all the opened forms by the current Application..??
For index AsInteger = My.Application.OpenForms.Count - 1To0Step-1
openForm = My.Application.OpenForms.Item(index)
If openForm IsNot Me AndAlso Not TypeOf openForm Is DevExpress.Utils.Win.TopFormBaseThen
openForm.Close()
openForm.Dispose()
openForm = Nothing
EndIf
Next
but there were some forms that were not close or rather I say was not detected as openforms.
My question is when during opening the form and it encounters some errors but still able to load the form, does the form considered as not an openform?
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.