title: Passing value from child to mdi parent in VB.net
body: <p>I have a simple contact book. The application has a main window that's an mdi form. When a contact is added using the "add a contact" form, I want to show a simple feedback message in the parent window status bar saying that the contact was added successfully.</p>
  
  <p>Here's the child loading:</p>
  
  <pre><code>Private Sub addButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addButton.Click
      Dim af As New addForm
      af.MdiParent = Me
      af.Show()
  End Sub
  </code></pre>
  
  <p>The problem is that since the parent is actually an mdi parent, and the "add a contact" form is launched with <code>.Show()</code> instead of <code>.ShowDialog()</code>, I can't store any return value that can be used by the launching Sub to perform an action.</p>
  
  <p>Is there a way to pass a value from this child to the mdi parent? Here's the child form doing it's stuff:</p>
  
  <pre><code>Private Sub addButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addButton.Click
  
      Dim contact = &lt;contact&gt;
                        &lt;quickName&gt;&lt;%= quickNameTextBox.Text %&gt;&lt;/quickName&gt;
                        &lt;firstName&gt;&lt;%= firstNameTextBox.Text %&gt;&lt;/firstName&gt;
                        &lt;lastName&gt;&lt;%= lastNameTextBox.Text %&gt;&lt;/lastName&gt;
                        &lt;email&gt;&lt;%= emailTextBox.Text %&gt;&lt;/email&gt;
                        &lt;website&gt;&lt;%= websiteTextBox.Text %&gt;&lt;/website&gt;
                        &lt;telephone&gt;&lt;%= telephoneTextBox.Text %&gt;&lt;/telephone&gt;
                        &lt;mobile&gt;&lt;%= mobileTextBox.Text %&gt;&lt;/mobile&gt;
                    &lt;/contact&gt;
  
      Dim contactList = XDocument.Load("contactList.xml")
  
      contactList.Elements()(0).Add(contact)
      contactList.Save("contactList.xml")
      //something here to trigger the status update in the parent?
      //trivia: SO doesn't support VB single-quote comments...
      Me.Close()
  
  End Sub
  </code></pre>
  
  <p>P.S. Apparently, I'm rather bad at tagging things...so anyone wanting to retag this question are most welcome.</p>