C#listview如何点击时选中整个一行

2025-01-02 22:22:30
推荐回答(4个)
回答1:

设置ListView的属性FullRowSelect =true就可以啦

回答2:

listview.FullRowSelect = true;
或者在窗体设计器里面修改

回答3:

设置FullRowSelect为true

回答4:

//在listview的SelectedIndexChanged中写下
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{

foreach (int i in listView1.SelectedIndices)
{
listView1.Items[i].Selected = true;
}

}