2个回答
展开全部
Private Sub ListViewSelectedIndexChanged(sender As Object, e As EventArgs) _
Handles ListView1.SelectedIndexChanged
If ListView1.SelectedIndices.Count > 0 Then
Dim index As Integer = ListView1.SelectedIndices(0) + 1 '选中行的下一行索引
If index < ListView1.Items.Count Then
Dim item As ListViewItem = ListView1.Items(index)
MsgBox(item.Text) '第一列
MsgBox(item.SubItems(1).Text) '第二列
MsgBox(item.SubItems(2).Text) '第三列
End If
End If
End Sub
Handles ListView1.SelectedIndexChanged
If ListView1.SelectedIndices.Count > 0 Then
Dim index As Integer = ListView1.SelectedIndices(0) + 1 '选中行的下一行索引
If index < ListView1.Items.Count Then
Dim item As ListViewItem = ListView1.Items(index)
MsgBox(item.Text) '第一列
MsgBox(item.SubItems(1).Text) '第二列
MsgBox(item.SubItems(2).Text) '第三列
End If
End If
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询