private void label1_Click_1(object sender, EventArgs e)
{
label1.ForeColor = System.Drawing.Color.Black;
label2.ForeColor = System.Drawing.ColorTranslator.FromHtml("#37506D");
label4.ForeColor = System.Drawing.ColorTranslator.FromHtml("#37506D");
label11.ForeColor = System.Drawing.ColorTranslator.FromHtml("#37506D");
label5.ForeColor = System.Drawing.ColorTranslator.FromHtml("#37506D");
label43.ForeColor = System.Drawing.ColorTranslator.FromHtml("#37506D");
find f = this.MdiChildren.OfType<find>().SingleOrDefault();
if (f == null)
{
MDIParent1 frmMain = new MDIParent1();
f.Parent = frmMain;
splitContainer1.Panel2.Controls.Add(f);
f.Show();
}
else
{
f.BringToFront();
}
}fin
嗨,我是相当新的MDI表单,到目前为止我有这个代码。这个想法是只打开一个孩子,如果有任何孩子打开,用户再次点击标签,关闭它并打开正在调用的孩子。我还有其他想要打开的孩子,但我不知道如何确保在点击标签时只有一个表格。
找到我的MDIChild