随笔分类 - C#前端 / Winform
摘要:private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e == null || e.Value == null || !(sender is Data
阅读全文
摘要:一、创建MDI应用 MDI:Multiple Document Interface 就是有一个主窗体和N个子窗体 主窗体: 1.设置IsMdiContainer属性为True 2.使用ActiveMdiChild获取当前活动的子窗体 3.使用MdiChildren获取所有的子窗体 4.使用Layou
阅读全文
摘要:我们在Winform项目中中需要插入图片资源,但是新建的项目中找不到Resources文件夹,怎么才能出现呢? 1:双击项目下的Resources.resx,出现视图 2:单击"添加资源",选择"添加现有文件",找到你要添加的图片,确定之后保存就可以了 3:这时候你会发现视图中出现添加的图片,解决方
阅读全文
摘要:FileSystemWatcher控件主要功能: 监控指定文件或目录的文件的创建、删除、改动、重命名等活动。可以动态地定义需要监控的文件类型及文件属性改动的类型。 1.常用的几个基本属性: (1) Path :设置要监视的目录的路径。 (2) IncludeSubdirectories :设置是否级
阅读全文
摘要:方法一: this.listBox1.SelectedIndex = this.listBox1.Items.Count - 1; 方法二: this.listBox1.TopIndex = this.listBox1.Items.Count - (int)(this.listBox1.Height
阅读全文