首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

怎样获取checkedListBox 中选中的项的文本?解决方案

2012-01-23 
怎样获取checkedListBox 中选中的项的文本?怎样获得呢?我想获取checkedListBox中所选中(打勾)的文本,怎样

怎样获取checkedListBox 中选中的项的文本?
怎样获得呢?我想获取checkedListBox中所选中(打勾)的文本,怎样获得?如果选择了多项,应该怎样一项一项的取出呢?

[解决办法]
string output = string.Empty;
for (int i = 0; i < checkedListBox1.CheckedIndices.Count; i++)
{
output += checkedListBox1.Items[
checkedListBox1.CheckedIndices[i]].ToString() + "\r\n ";
}
MessageBox.Show(output);

热点排行