"Simon" <Si***@microsoftforums.com> schrieb:
I setup a Midi & Child form
I can open the child form and display info from a Text file
I need to enable the user to change info on the child form and when
closed write the text file back to disk....
How do I tell the Main from to detect when the Child form closes???
I am curious why you don't implementing the "write to disk" feature in your
MDI child form. The form's 'Closing' and 'Closed' events will be raised
when the form is closed. If you are creating the MDI child form within the
MDI container, you can use 'AddHandler' to add a handler to the MDI child's
'Closed' event. You can add a common handler for all MDI children:
\\\
Dim f As New ChildForm()
f.MdiParent = Me
AddHandler f.Closed, AddressOf Me.ChildForm_Closed
..
..
..
Private Sub ChildForm_Closed( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles MyBase.Closed
DirectCast(sender, ChildForm).SaveDocument()
End Sub
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>