hi,
im developing a mdi application and want to close this application and all its child forms using a button but im not sure how to do it. Please note that this button is NOT in parent form but in one of the child form. here is my sample code. is it correct way to do it??
[CODE=vbnet]Private Sub btnCancel_Click (ByVal sender As System.Object, ByVal e As System.EventArg s) Handles btnCancel.Click
Dim frm As New frmMain 'this is the parent form
For Each temp As Form In frm.MdiChildren
temp.Dispose()
Next
Application.Exi t()
End Sub [/CODE]
im using .NET 1.1 and VS 2003
im developing a mdi application and want to close this application and all its child forms using a button but im not sure how to do it. Please note that this button is NOT in parent form but in one of the child form. here is my sample code. is it correct way to do it??
[CODE=vbnet]Private Sub btnCancel_Click (ByVal sender As System.Object, ByVal e As System.EventArg s) Handles btnCancel.Click
Dim frm As New frmMain 'this is the parent form
For Each temp As Form In frm.MdiChildren
temp.Dispose()
Next
Application.Exi t()
End Sub [/CODE]
im using .NET 1.1 and VS 2003
Comment