How will i close all the forms within my main form? Everytime I click on the menus of my main form,I'm setting my main form as MDI-Parent form and then loading a new form as it it is the child form if I'm not mistaken. I have a log-out menu, and what I want to happen is everytime I log-out all the forms within my parent form will be closed. How will I do it? Here are some of my codes.
Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem1.Click
Dim approval As New frmApproval
frmApproval.MdiParent = Me
frmApproval.Show()
End Sub
------------------------------------
Private Sub LogoutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogoutToolStripMenuItem.Click
If MsgBox("Are you sure you want to log-out?", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Exit") = MsgBoxResult.Yes Then
Me.Hide()
frmLogin.Show()
Else
End If
End Sub