Hi !
Well, did a small test and this works just find. To just test the basics of what you are trying to accomplish, I created a new project (and I'm sorry, it's in vb) and just tested that one problem of having a messagebox displaying after childform has been closed, without childform being visible on screen.
So, I have two forms, ParentForm and ChildForm. Each has one button similar to yours. ParentForm is the startup form.
ParentForm has the following code:
Private Sub btnShowChild_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowChild.Click
Dim cf As ChildForm = New ChildForm
AddHandler cf.Closed, AddressOf CloseHandler
cf.ShowDialog()
End Sub
Public Sub CloseHandler(ByVal sender As Object, ByVal e As EventArgs)
MessageBox.Show("Child form has now been closed")
End Sub
ChildForm has the following code:
Private Sub btnDoIt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDoIt.Click
MessageBox.Show("After this is closed, form closes and another message shows", _
New EventHandler(AddressOf MessageBox_Close))
End Sub
Private Sub MessageBox_Close(ByVal sender As Object, ByVal e As EventArgs)
Me.Close()
End Sub
By clicking ParentForm's button, the ChildForm is shown. By clicking ChildForm's button you get it's messagebox, and when you click OK there, the ChildForm closes and then you get the second messagebox from CloseHandler in Parentform.
This was tested both in IE7 and FF3 and works perfectly.
Is this different from what you were trying to do?
Palli