Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Have you set the <code>MainForm</code> to be an <code>MDIContainer</code>? To do this set its <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.form.ismdicontainer%28v=vs.71%29.aspx" rel="nofollow">IsMdiContainer</a> property to true; Also check it has <code>File</code> and <code>Window</code> top-level menu items and <code>New</code> and <code>Close</code> menu items. (The tutorial suggests this, I know it should have a <code>Window</code> menu item at least).</p> <p>Have a look at this tutorial for more guidance: <a href="http://msdn.microsoft.com/en-us/library/aa984329%28v=vs.71%29.aspx" rel="nofollow">Creating MDI Child Forms (MSDN)</a></p> <p><strong>EDIT:</strong> Looking at it more closely, it seems you are creating a new instance of MainForm, and trying to show the form as a child of that instance, as opposed to showing it in the existing MainForm. I assume you already have an instance of MainForm open at this point? And assuming the OutputForm and AddAnime forms are children of MainForm you could call the existing instance's method like this:</p> <pre><code>private void NewAnime_Click(object sender, EventArgs e) { this.ParentForm.mShowForm(2); this.Close(); } </code></pre> <p>but ideally you should have an event on DataBaseOutput that MainForm listens to, and shows the new Form when the event is raised. See here for more info <em>(it talks about user controls and not child forms, but the principle is the same)</em>:</p> <p><a href="http://www.codeproject.com/KB/cs/agusercontrol.aspx" rel="nofollow">Calling parent form functions from a user control</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload