码迷,mamicode.com
首页 > Windows程序 > 详细

MDI弹出唯一窗体

时间:2016-07-07 09:49:22      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:

 1 /// <summary>
 2         /// 点击开启学生窗体
 3         /// </summary>
 4         /// <param name="sender"></param>
 5         /// <param name="e"></param>
 6         private void pictureBox6_Click(object sender, EventArgs e)
 7         {
 8             bool Has = false;
 9             Form3 F3 = new Form3();
10             F3.Tag = "F3";
11             foreach (Form F in panel1.Controls)
12             {
13                 if (F.Tag == F3.Tag)
14                 {
15                     F.Show();
16                     F3.Close();
17                     Has = true;
18                 }
19                 else
20                 {
21                     F.Hide();
22                 }
23             }
24             if (Has == false)
25             {
26                 F3.WindowState = FormWindowState.Maximized;
27                 F3.MdiParent = this;
28                 F3.Parent = panel1;
29                 F3.Show();
30             }
31         }
32         /// <summary>
33         /// 点击开启教师窗体
34         /// </summary>
35         /// <param name="sender"></param>
36         /// <param name="e"></param>
37         private void pictureBox5_Click(object sender, EventArgs e)
38         {
39             bool Has = false;
40             Form4 F4 = new Form4();
41             F4.Tag = "F4";
42             foreach (Form F in panel1.Controls)
43             {
44                 if (F.Tag == F4.Tag)
45                 {
46                     F.Show();
47                     F4.Close();
48                     Has = true;
49                 }
50                 else
51                 {
52                     F.Hide();
53                 }
54             }
55             if (Has == false)
56             {
57                 F4.WindowState = FormWindowState.Maximized;
58                 F4.MdiParent = this;
59                 F4.Parent = panel1;
60                 F4.Show();
61             }
62         }

 

MDI弹出唯一窗体

标签:

原文地址:http://www.cnblogs.com/mazhijie/p/5648737.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!