摘要: 检查要打开的窗口是否已经是打开状态private void TestApplicationOpenFormsMethod() { #region 测试代码一 Form temp_form = new Form(); temp_form.Name = "MyForm"; foreach (Form f in Application.OpenForms) { if (f.Name == temp_form.Name) ... 阅读全文
posted @ 2011-11-16 17:34 心_远 阅读(222) 评论(0) 推荐(0) 编辑
摘要: bool isopen=false; foreach (Form childrenForm in this.MdiChildren) { if (childrenForm.Name=="fatherName")//这里对你来说应该是form2 { childrenForm.Visible = true;//如果你要求关闭的话就只要close就可以了,我现在是如果存在就显示,你可以参考一下,你也可以不 childrenFor... 阅读全文
posted @ 2011-11-16 17:03 心_远 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 在网络中搜索了下,发现使用接口来刷新父窗体,自己认为比较方便。也比较好容易理解。所以我也特此写一片博客进行记录,对自己进行深入的学习和方便再回头来复习。很多东西都是自己以前做过的,但是很长一段时间之后不代表就能很顺心的能写出来,所以我只能用博客文章记录我的点滴,下次翻阅的时候至少我会想起来在某个项目中使用到了这个情景。首先定义一个接口:using System;using System.Collections.Generic;using System.Text;namespace WinFormSendValue{ publicinterface IForm { v... 阅读全文
posted @ 2011-11-16 16:28 心_远 阅读(347) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Xml;using Zone;using System.Runtime.InteropServices;namespace 操作xml{ public partial class Form1 : Form { private int... 阅读全文
posted @ 2011-11-16 13:52 心_远 阅读(168) 评论(0) 推荐(0) 编辑
摘要: this.listView1.GridLines = true; //显示表格线 this.listView1.View = View.Details;//显示表格细节 this.listView1.LabelEdit = true; //是否可编辑,ListView只可编辑第一列。 this.listView1.Scrollable = true;//有滚动条 this.listView1.HeaderStyle = ColumnHeaderStyle.Clickable;//对表头进行设置... 阅读全文
posted @ 2011-11-16 09:03 心_远 阅读(8931) 评论(0) 推荐(0) 编辑