父窗体包含两个子窗体
2016-01-08 20:53
429 查看
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication18 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public void showform(Form f) { int count = 0; foreach (Form ff in this.MdiChildren) { if (f.Name == ff.Name) { ff.Focus(); count++; } } if(count==0) { f.MdiParent = this; f.Show(); } } private void 窗体一ToolStripMenuItem_Click(object sender, EventArgs e) { Form4 f = new Form4(); showform(f); } private void 窗体二ToolStripMenuItem_Click(object sender, EventArgs e) { Form5 f = new Form5(); showform(f); } } }
相关文章推荐
- Egret3D 研究报告(一)初试
- 第一个数字(数字的值返回)
- 架构设计的UML图形思考
- POJ 3580 SuperMemo Splay/可持久化Treap 维护区间
- POJ 3630 Phone List Trie题解
- python学习之html从0开始(二)
- 扑克牌排列
- 简单类型的数据查询
- 删除数据纯代码演示
- python 安装ggplot包
- JAVA蓝桥杯(6)括号问题
- python中变量类型
- hi3518E下载ram debug碰到ramdisk过小的问题
- NSURLSession下载和使用SSZipArchive解压缩
- C语言复合字面量的使用
- Linux运维 第三阶段 (十七) memcached
- JAVA蓝桥杯(5)手机尾号评分
- 变量的定义与声明
- priority_queue的使用:简单类型与结构体
- adb操作命令详解及大全