当前位置: 代码迷 >> .NET相关 >> WinForm上怎么遍历CheckBoxList
  详细解决方案

WinForm上怎么遍历CheckBoxList

热度:3289   发布时间:2013-02-26 00:00:00.0
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循环
  相关解决方案