点击ListView 获取所选择行的数据

鼠标单击或者双击listView 行,或者相关的行数据

if (lvUserInfo.SelectedIndices != null && lvUserInfo.SelectedIndices.Count > 0)
            {
                ListView.SelectedIndexCollection indexCollection = lvUserInfo.SelectedIndices;
                txtUserID.Text = lvUserInfo.Items[indexCollection[0]].Text;
                txtUserName.Text = lvUserInfo.Items[indexCollection[0]].SubItems[0].Text;
                txtHomePhone.Text = lvUserInfo.Items[indexCollection[0]].SubItems[1].Text;
                txtCardID.Text = lvUserInfo.Items[indexCollection[0]].SubItems[2].Text;
                txtPhone.Text = lvUserInfo.Items[indexCollection[0]].SubItems[3].Text;

            }