// 添加数据方法 ArrayList Dic = new ArrayList();
DictionaryEntry entry = new DictionaryEntry();
int m_taskListCount = this.m_taskList.Count;
for (int i = 0; i < m_taskListCount; i++)
{
entry.Key = m_taskList.Item(i).Attribute(”id”);
entry.Value = m_taskList.Item(i).Value;
Dic.Add(entry);
}
CbTaskList.DataSource = Dic;
CbTaskList.DisplayMember = “value”;
CbTaskList.ValueMember = “key”;// 使用方法 foreach (object i in CbTaskList.Items)
{
if (((DictionaryEntry)i).Key.ToString() == taskId)
{
CbTaskList.SelectedItem = i;
return;
}
}Tags: Combobox遍历
Posted in .net | 1 Comment »WinForm给ComboBox增加Value(转)
January 7th, 2008
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”;
DictionaryEntry entry = new DictionaryEntry();
int m_taskListCount = this.m_taskList.Count;
for (int i = 0; i < m_taskListCount; i++)
{
entry.Key = m_taskList.Item(i).Attribute(”id”);
entry.Value = m_taskList.Item(i).Value;
Dic.Add(entry);
}
CbTaskList.DataSource = Dic;
CbTaskList.DisplayMember = “value”;
CbTaskList.ValueMember = “key”;// 使用方法 foreach (object i in CbTaskList.Items)
{
if (((DictionaryEntry)i).Key.ToString() == taskId)
{
CbTaskList.SelectedItem = i;
return;
}
}Tags: Combobox遍历
Posted in .net | 1 Comment »WinForm给ComboBox增加Value(转)
January 7th, 2008
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”;
解决方案 »
- 奇怪的问题?php文件,ie下第一次加载会404,只有刷新才可以
- 我的error_reporting()函数怎么会没效果呢?
- 请教一个正则表达式的意思
- apache 2.2.0+mysql 5.0.18+php 5.1.1编译安装成功
- [分享|讨论]我有一个好想法,不晓得这会不会只是一个天才的想法,而没有实现的可能性。
- 有人想让我做一个六合彩的网站,大家觉得如何?
- 请教:如何在PHP中交替取出MYSQL中两个或多个表中的值?
- 页面的变量值怎么消失了 ?
- 安装了apache和php4之后不能用的问题。
- 请告诉我一个简单的防止用户刷新增长计数的方法!
- 请教SQL语句
- 一个很细小的大问题关于PHP链接MySQL
我最近也要做gtall功能
呵呵
稍微了解了一上,不好做!
最新的去php.net一看就知道了
我唯一喜欢过的师姐去年就跟别人结婚了,继续单身中……