[.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;
}
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;
}
相关文章推荐
- [.Net2.0]如何实现Winform中CheckedListBox的全选与取消和读取所有选中项的文本
- 如何实现checkbox的全选/取消
- 如何用jquery实现checkbox的全选、反选、取消反选,以及如何得到选中的checkbox的值
- C#WinForm开发系列之CheckBox控件全选和取消全选以及checkedListBox的基础使用介绍
- 单击头模板中的checkbox,实现datalist中所有chebox的全选和取消
- Listview嵌套CheckBOX 实现全选反选取消,并对选中项进行标记
- jQuery选择器:input实现—全选,反选,取消(匹配所有 input, textarea, select 和 button 元素)
- asp.net单击头模板中的checkbox,实现datalist中所有chebox的全选和取消
- 如何实现单击UltraTextEditor的时候全选文本?
- 如何实现复选框的全选和取消全选效果
- 关于css中树形的开闭以及复选框checkbox如何全选取消的实现
- jQuery选择器:input实现—全选,反选,取消(匹配所有 input, textarea, select 和 button 元素)
- 单击头模板中的checkbox,实现datalist中所有chebox的全选和取消
- 如何在Flex中实现全选DataGrid中的所有Item
- C#的winform程序下如何实现文本编辑框(TextBox)的Hint提示文字效果
- winform CheckedListBox实现全选/全不选
- 如何利用jquery实现一句话全选/取消全选的实例代码
- JS如何实现对name是数组的复选框的全选和反选以及取消选择
- jquery实现点击复选框,勾选所有复选框,再次点击取消全选
- 安卓如何实现list的全选效果