private void button2_Click(object sender, EventArgs e) { z_c zc = new z_c(); this.Hide(); zc.ShowDialog(); }
private void 新建ToolStripMenuItem_Click(object sender, EventArgs e) { //判断窗口是否打开过 foreach (Form childForm in this.MdiChildren) { //判断打开的子窗体镇南关,是否存在该子窗体 if (childForm is z_c) { //说明有打开过的窗口 childForm.Visible = true; //设置活动窗口 childForm.Activate(); //获得焦点 childForm.Focus(); //窗口最大化 //childForm.WindowState = FormWindowState.Maximized; return; } } z_c zc = new z_c(); zc.MdiParent = this; zc.Show(); //窗口最大化 //zc.WindowState = FormWindowState.Maximized; // Mdiparent }