简体   繁体   中英

How do I make a button make a form in another form?

So in my current situation I have my Desktop form set to open things inside that form through the MDI.Container.

I have a form automatically open when the Desktop form is started. After reading that form you would click "next" on the form button and it SHOULD open the new form in the same mdi container, but instead it opens it in a new window in my actual OS. I want it to open in the original MDI container in the Desktop form. If you can help me out please do!

I've tried the following:

this.IsMdiContainer = true;
Welcome welcome = new Welcome();
welcome.MdiParent = this;
welcome.Show();

Would this help? I'm not sure to get your question

// C#
protected void MDIChildNew_Click(object sender, System.EventArgs e)
{
    Form2 newMDIChild = new Form2();
    // Set the Parent Form of the Child window.
    newMDIChild.MdiParent = this;
   // Display the new form.
   newMDIChild.Show();
}

问题是您在代码中使表单ismdicontainer = true正确,因此在设计时(而不是在运行时)应使表单ismdicontainer为true。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM