[英]How do I make a button make a form in another form?
因此,在當前情況下,我將“桌面”表單設置為通過MDI.Container打開該表單中的內容。
啟動桌面表單后,我有一個表單自動打開。 閱讀完該表單后,您將單擊“表單”按鈕上的“下一個”,它應該在相同的mdi容器中打開新表單,但是它將在我的實際OS的新窗口中打開它。 我希望它在“桌面”表單的原始MDI容器中打開。 如果可以幫助我,請做!
我嘗試了以下方法:
this.IsMdiContainer = true;
Welcome welcome = new Welcome();
welcome.MdiParent = this;
welcome.Show();
這樣有幫助嗎? 我不確定你的問題
// 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。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.