您的位置:首页 > 其它

[.Net2.0]如何实现Winform中CheckedListBox的全选与取消和读取所有选中项的文本

2007-09-18 11:43 681 查看
public void checkAllState(bool check)

public string GetTags()

{

string tags="";

//for (int i = 0; i<checkedListBox1.Items.Count; i++)

//{

// if (checkedListBox1.GetItemChecked[i])

// {

// tags += checkedListBox1.

// }

//}

foreach (object itemChecked in checkedListBox1.CheckedItems)

{

// Use the IndexOf method to get the index of an item.

//MessageBox.Show("Item with title: \"" + itemChecked.ToString() + "\", is checked. Checked state is: " + checkedListBox1.GetItemCheckState(checkedListBox1.Items.IndexOf(itemChecked)).ToString() + ".");

tags += itemChecked.ToString();

}

return tags;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐