随笔分类 -  C#

摘要:public class DirectoryAllFiles { static List FileList = new List(); public static List GetAllFiles(DirectoryInfo dir) { FileInfo[] allFile = dir.GetFiles(); foreach (FileI... 阅读全文
posted @ 2017-03-31 16:36 苏州城外的微笑 阅读(384) 评论(0) 推荐(0)
摘要:调用 递归生成树 阅读全文
posted @ 2017-03-31 14:31 苏州城外的微笑 阅读(4763) 评论(0) 推荐(0)
摘要:List llb;//符合条件像的listbox数据集合 public static List datalist = new List();//总的数据源 int pageIndex = 1;//当前页 int pageSize = 16;//一页最大容量 int totalPage = 0;//总页数 public ... 阅读全文
posted @ 2017-02-28 11:57 苏州城外的微笑 阅读(836) 评论(0) 推荐(0)
摘要:界面 <WindowsFormsHost Grid.Row="1" Grid.RowSpan="2" Opacity="1" FontSize="14"> <wf:TreeView x:Name="tree" AfterSelect="tree_AfterSelect"></wf:TreeView> 阅读全文
posted @ 2017-02-10 14:23 苏州城外的微笑 阅读(4446) 评论(0) 推荐(0)
摘要:C# 操作excel C# 操作excel //导出Excel private void ExportExcel(string fileName, System.Data.DataTable myDGV, string title) { string saveFileName = ""; Syste 阅读全文
posted @ 2016-12-22 12:32 苏州城外的微笑 阅读(10611) 评论(0) 推荐(1)
摘要:<Window x:Class="WpfTutorialSamples.TreeView_control.TreeViewDataBindingSample" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmln 阅读全文
posted @ 2016-10-11 15:42 苏州城外的微笑 阅读(361) 评论(0) 推荐(0)
摘要:<Window x:Class="WpfTutorialSamples.ListView_control.ListViewGridViewSample" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x 阅读全文
posted @ 2016-10-11 15:41 苏州城外的微笑 阅读(517) 评论(0) 推荐(0)
摘要:<Window x:Class="testGridSplitter.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/ 阅读全文
posted @ 2016-10-11 15:39 苏州城外的微笑 阅读(3635) 评论(0) 推荐(0)
摘要:它的主要特点不是根据客户程序调用生成一个新的实例,而是控制某个类型的实例数量-唯一一个。(《设计模式-基于C#的工程化实现及扩展》,王翔)。也就是说,单例模式就是保证在整个应用程序的生命周期中,在任何时刻,被指定的类只有一个实例,并为客户程序提供一个获取该实例的全局访问点。 第一种最简单,但没有考虑 阅读全文
posted @ 2016-09-21 17:32 苏州城外的微笑 阅读(10060) 评论(0) 推荐(0)
摘要:首先在主窗体中将菜单关联的窗体实例化。 第二步:将每个菜单对应窗体的closing事件重写。之所以要重写closing事件,是因为在菜单对应的窗口关闭之后,再次打开就会报错 第三步:在主窗体中菜单事件里面进行判断处理 示例: public partial class main : Window { 阅读全文
posted @ 2016-09-21 16:49 苏州城外的微笑 阅读(2947) 评论(0) 推荐(0)
摘要:该方法是通过更改ShowDetail的状态来实现的隐藏属性 首先在引用里右键 管理NuGet程序包 查找extended wpf toolkit 并安装 然后在MainWindow.xaml添加引用 xmlns:extoolkit="http://schemas.xceed.com/wpf/xaml 阅读全文
posted @ 2016-08-17 17:44 苏州城外的微笑 阅读(1981) 评论(0) 推荐(0)
摘要:1. string str = "32323";2. double a = (double)str ;3. double a = Convert.ToDouble(str); 第3行会转换成功,第2行就会报错,ToDouble方法会自动进行溢出检查,但是为什么第2行会失败? 转换方法 Method1 阅读全文
posted @ 2016-06-28 09:50 苏州城外的微笑 阅读(7496) 评论(0) 推荐(0)