Newby - HELP with midi form / Child forms

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

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???
 
Simon said:
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
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top