2009-08-29 248 views
1

我知道使用表示其他形式的形式follwing兩種方法MDI父子窗體位置問題

方法1

public Form1() 
{ 
    InitializeComponent(); 

    Form2 embeddedForm = new Form2(); 
    embeddedForm.TopLevel = false; 
    Controls.Add(embeddedForm); 
    embeddedForm.Show(); 
} 

方法2

Form1 fChild = new Form1(); 
fChild.MdiParent = this; 
fChild.Show(); 

我需要學習如何在父窗體小組中顯示此子窗體

或者如果有人能告訴我如何設置x,子窗體的y座標

回答

1

您可以隨時更改形式的父母,例如:

fChild.TopLevel = false; 
fChild.Parent = fParent.panel1;