C#在ListView中获取CheckBox选中的值(多选)

2025-01-03 22:15:03
推荐回答(2个)
回答1:

string list = "";
for (int i = 0; i < this.listView1.CheckedItems.Count; i++)
{
if (this.listView1.CheckedItems[i].Checked)
{
list += this.listView1.CheckedItems[i].Text + ",";
}
}

回答2:

foreach ( ListViewItem item in ListView1.CheckedItems)
{
Console.Writeline(item.SubItems[1].Text);
}