可以如下:
private void btnShowSubWin_Click(object sender, System.EventArgs e)
{
foreach ( Form f in this.OwnedForms )
{
if (f is frmSubForm) //frmSubForm为显示子窗体类名
{
f.Show();
f.Focus();
return;
}
}
//need a new one
frmSubForm mySubForm = new frmSubForm();
this.AddOwnedForm(mySubForm);
mySubForm.Owner = this;
mySubForm.TopLevel=false;
mySubForm.Show();
}