随笔分类 - C# WinForm/WPF
摘要:方式一、通过泛型Dictionary绑定View Code Dictionary<int,string>mydic=newDictionary<int,string>(){{0,"aaaa"},{1,"bbbb"},{2,"cccc"}};cobxUserType.ItemsSource=mydic;cobxUserType.SelectedValuePath="Key";cobxUserType.DisplayMemberPath="Value";然后通过cobxUse
阅读全文
摘要:今天初始WPF,以前只是了解,没怎么用过,其实我个人感觉,除了界面效果可能比WinForm也好些,其他的也都是大同小异,也就是写法,或者一些语法不太一样,其他的和winform的思想都是差不多的,学过winForm的,在学Wpf,比较容易些: 首先,我们来新建一个wpf应用程序 然后我们可以看到创建的项目中有以下几个文件 App.xaml文件定义启动应用程序<Applicationx:Class="WpfApplication1.App"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentat
阅读全文
摘要:http://www.cnblogs.com/peterzb/archive/2009/05/30/1491923.html 下面介绍三种对comboBox绑定的方式,分别是泛型中IList和Dictionary,还有数据集DataTable一、IList现在我们直接创建一个List集合,然后绑定View Code IList<string>list=newList<string>();list.Add("111111");list.Add("222222");list.Add("333333");list.A
阅读全文

浙公网安备 33010602011771号