惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LINUX DO - 热门话题
Stack Overflow Blog
Stack Overflow Blog
B
Blog
WordPress大学
WordPress大学
Project Zero
Project Zero
P
Palo Alto Networks Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 司徒正美
有赞技术团队
有赞技术团队
S
SegmentFault 最新的问题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
T
Tailwind CSS Blog
Forbes - Security
Forbes - Security
F
Full Disclosure
SecWiki News
SecWiki News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Hacker News: Ask HN
Hacker News: Ask HN
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
F
Fortinet All Blogs
Cisco Talos Blog
Cisco Talos Blog
G
Google Developers Blog
J
Java Code Geeks
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recorded Future
Recorded Future
O
OpenAI News
Spread Privacy
Spread Privacy
MongoDB | Blog
MongoDB | Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Cybersecurity and Infrastructure Security Agency CISA
S
Securelist
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
IT之家
IT之家
U
Unit 42
腾讯CDC
S
Security Affairs
C
Cisco Blogs
Schneier on Security
Schneier on Security
The Last Watchdog
The Last Watchdog
B
Blog RSS Feed
宝玉的分享
宝玉的分享
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security @ Cisco Blogs
Cyberwarzone
Cyberwarzone
T
The Blog of Author Tim Ferriss

博客园 - 小孔子

忙于生计,一直没时间上来 小孔子内容管理系统v2.1 Beta1 正式发布小孔子内容管理系统V2.1源码 以前写的一个邮件群发 小孔子内容管理系统V2.1测试 FckEditor采集远程图片插件完美版 发布小孔子图书管理系统(仿VS拖曳窗口) V2.0发现的Bug 小孔子内容管理系统V2.0正式开源发布 小孔子内容管理系统V2.0测试 着手准备小孔子内容管理系统升级,请大家提建议 关于网站被黑 小孔子内容管理系统更新历史 2007.8.6 小孔子内容管理系统第一次更新 文章管理系统v2后台登陆的问题解决办法 感谢Calvin大哥提供测试空间 小孔子内容管理系统相关问题及回答区 小孔子内容管理系统开源发布 向写过采集系统的高手求教
WinForm给ComboBox增加Value(转)
小孔子 · 2007-09-27 · via 博客园 - 小孔子

做一个图书管理系统,用到了combobox,
天呀,竟然不能像DropDownList那样直接使用键值对的方式
百度了半天,终于找到方法,发出来大家共享
用DataTable可以!但是总不能象男,女这样两项也用一个DataTable吧, 这也太麻烦了啊!
用Hashtable,SortedList直接添加键值对都报错了!
经过我多方的考究,最后终于搞定了,就用ArrayList就可以了!
    代码可以这样写!
  ArrayList mylist = new ArrayList();
  mylist.Add (new DictionaryEntry ("1","坏"));
  mylist.Add (new DictionaryEntry ("2","不好"));
  mylist.Add (new DictionaryEntry ("3","一般"));
  mylist.Add (new DictionaryEntry ("4","好"));
  mylist.Add (new DictionaryEntry ("5","太好了"));
  comboBox1.DataSource =mylist;
  comboBox1.DisplayMember ="Value";
  comboBox1.ValueMember ="Key";

posted on 2007-09-27 22:18  小孔子  阅读(1517)  评论()    收藏  举报