프로그래밍/Visual C#
MDI 폼 만들기
Dev-Drake
2019. 12. 30. 17:31
반응형
부모 폼 생성자에서 MDI 폼 모드로 변경
public MainForm()
{
InitializeComponent();
this.IsMdiContainer = true;
}
버튼 클릭 시 자식 폼 띄우면서 MdiParent = this로 설정한다.
private void button1_Click(object sender, EventArgs e)
{
Form2 newMDIChild = new Form2();
newMDIChild.MdiParent = this;
newMDIChild.Show();
}
호출한 폼을 부모 폼, 호출 당한 폼을 자식 폼이라 부르면 자식 폼은 부모 폼 영역 안에서만 표시되게 됩니다.
반응형