C#中获取CheckListBox选中项的值
/// <summary>
/// C#中获取CheckListBox选中项的值。
/// </summary>
/// <param name="clb">要被获取选中项的CheckListBox类型的对象。</param>
/// <returns>返回一个ArrayList类型的对象。</returns>
private ArrayList GetCheckedItemsText(CheckedListBox clb)
{
ArrayList result = new ArrayList();
IEnumerator myEnumerator = clb.CheckedIndices.GetEnumerator();
int index;
while (myEnumerator.MoveNext())
{
index = (int)myEnumerator.Current;
clb.SelectedItem = clb.Items[index];
result.Add(clb.Text);
}
return result;
}
我在青春的田野上播种勤奋与努力,希望能在未来收获成熟和睿智...