문제

I have a mdi parent form and I open my other forms in run time as mdi child form by this code:

private void MenuItem_Click(object sender, EventArgs e)
{
    childform = new childform ();
    frm.MdiParent = Mdiparent;
    frm.WindowState = FormWindowState.Maximized;
    frm.Show();
}

but the problem is: When current form is open, user can open another form and it can be repeated several times so that each form is opened what's code for closing the current child form before user open a new child form??

도움이 되었습니까?

해결책

tanx for ur assist :) I Found effective code by test other Members in Class Windows.forms just enough check this :

if (ActiveMdiChild != null)
    ActiveMdiChild.Close();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top