首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

WinForm上怎么遍历CheckBoxList

2013-01-02 
WinForm下如何遍历CheckBoxList?很简单的一个问题![解决办法]for(int i 0iChecklistBox.Items.counti+

WinForm下如何遍历CheckBoxList?
很简单的一个问题!
[解决办法]
for(int i =0;i<ChecklistBox.Items.count;i++)
{
  MessageBox.Show(ChecklistBox.Items[0].ToString());
}
[解决办法]
List<T> lst=new List<T>();
for(int i =0;i <ChecklistBox.Items.count;i++) 

if(ChecklistBox.Items[0].Selected)
  lst.Add(List.ChecklistBox.Items[0]); 
}
或用foreach循环

热点排行