c# listview 如何获得选中列 第几列,

2024-12-15 12:51:32
推荐回答(1个)
回答1:

private void listView1_ItemActivate(object sender, EventArgs e)
{
ListView lv = (ListView)sender;
string filename = lv.SelectedItems[0].SubItems[1].Text;
//获取第1列的值
MessageBox.Show(filename);
}