操作checklistbox选中值的方法
来源:互联网 发布:红异端改淘宝 编辑:程序博客网 时间:2024/06/05 01:55
方法一
private ArrayList GetCheckedItemsText(CheckedListBox lst_items)
{
ArrayList result = new ArrayList();
IEnumerator myEnumerator;
myEnumerator = lst_items.CheckedIndices.GetEnumerator();
int index;
while (myEnumerator.MoveNext() != false)
{
index = (int)myEnumerator.Current;
lst_items.SelectedItem = lst_items.Items[index];
result.Add(lst_items.Text);
}
return result;
}
方法二:
foreach (ListItem li in this.checklistbox1)
{
if (li.Selected = true)
{
excelstr += li.ToString() + ", ";
}
}
if (excelstr[excelstr.Length - 1].ToString() == ", ")
{
excelstr = excelstr.Substring(0, excelstr.Length - 1);
}
this.message.Text = excelstr;
另可参考:http://social.msdn.microsoft.com/Forums/ro-RO/visualcshartzhchs/thread/f811016c-3ae3-4211-894a-c9054db5dfd6
- 操作checklistbox选中值的方法
- vb.net Checklistbox 如何把选中的值移动到另个一checklistbox里面并且在原有的里面删除
- checklistbox多选取value值的问题
- jQuery操作CheckBox的方法(选中,取消,取值)详解
- jQuery操作CheckBox的方法(选中,取消,取值)详解
- jQuery操作CheckBox的方法(选中,取消,取值)
- jQuery操作CheckBox的方法(选中,取消,取值)详解
- checklistBox默认选中多个选项
- CheckListBox的一些用法!
- CheckListBox的使用(代码)
- c# checklistbox的用法
- c# checklistbox的用法
- c# checklistbox的用法
- CheckListBox控件的使用
- checklistbox的详细用法
- 获得CheckListBox的结果。
- CheckListBox的使用方法
- ChecklistBox的使用总结
- [MySQL]VC++通过Pipe连接数据库(ODBC)
- IE6 IE7 FF的CSS Hack总结
- JNDI配置原理详解
- 发布资源给大家分享 《游戏脚本编程》
- adb push 使用说明
- 操作checklistbox选中值的方法
- 初始化ifconfig计数办法
- Qt 4.x实现QMenu菜单向上弹出菜单方法
- 免费电子书列表
- 创建多组单选按钮
- PeopleSoft 8.47的安装配置
- 好铁不打钉,好程序员不去外包公司(转载)
- parent.window ,window.parent ,window.opener,opener.window的区别与用法
- C技巧:结构体参数转成不定参数