wpf combobox 的使用
来源:互联网 发布:顶管计算软件 编辑:程序博客网 时间:2024/05/07 16:55
IList<his_nation> customList = new List<his_nation>();
public Window1() { InitializeComponent(); BindCombobox(); }
初始化
public void BindCombobox() { IList<String> NationstrList = new List<String>(); NationstrList.Add("汉族"); NationstrList.Add("壮族"); NationstrList.Add("Cat"); String str = NationstrList[0]; customList.Add(new nation() { ID = 1, Name = "汉族" }); customList.Add(new nation() { ID = 2, Name = "壮族" }); customList.Add(new nation() { ID = 3, Name = "Cat" }); cbb_nation.ItemsSource = customList; cbb_nation.DisplayMemberPath = "Name"; cbb_nation.SelectedValuePath = "ID"; cbb_nation.SelectedValue = 1; }public class his_nation{ public int ID { get; set; } public string Name { get; set; }}
获取combobox选中的值
int tt = cbb_nation.SelectedIndex;
String name = customList[tt].Name;
- WPF Combobox的使用
- wpf combobox 的使用
- WPF Combobox TextSearch使用
- WPF中ComboBox的SelectionChanged方法的使用注意
- WPF comboBox内字体选择器的简单使用
- WPF的ComboBox数据绑定,使用Dictionary作为数据源
- wpf 之ComboBox的用法
- WPF ComboBox
- MVVM WPF 使用 datagrid 绑定 comboBox
- WPF 的COMBOBOX绑定(匿名类)
- WPF 自定义带有数据源的combobox控件
- WPF combobox 的两种绑定方式
- WPF学习笔记:ComboBox的数据绑定
- WPF的ComboBox 数据模板自定义
- 【WPF】两个下拉列表ComboBox的级联
- 一个自定义的WPF ComboBox模板
- combobox的使用
- combobox控件的使用
- excel统计技巧
- Inno[Code]代码段获取[Setup]段关键字值的方法
- 插入排序的链表,无头结点
- Struts2源码初探
- Android新浪微博客户端(一)——主框架搭建
- wpf combobox 的使用
- 项目选择 产品分析 效益分析 工具辨析
- [leetcode刷题系列]Combinations
- POJ 2478 Farey Sequence(法雷级数+欧拉函数递推)
- CoreAnimation编程指南(八)事务
- poj 3468 A Simple Problem with Integers
- Sql实现行列转换
- url-pattern 配置 详解 匹配
- 关于Bash---DOS到shell的转换