vb listview 中 我要做一个点击一个值 读取该值所在那个列的代码? 谢谢!

2024-12-05 08:50:09
推荐回答(3个)
回答(1):

Private Sub ListView1_Click()
If ListView1.ListItems.Count > 0 Then
Text1.Text = ListView1.SelectedItem.Text
Text2.Text = ListView1.SelectedItem.SubItems(1)
Text3.Text = ListView1.SelectedItem.SubItems(2)
Text4.Text = ListView1.SelectedItem.SubItems(3)
Text5.Text = ListView1.SelectedItem.SubItems(4)
Text6.Text = ListView1.SelectedItem.SubItems(5)
End If
End Sub

回答(2):

Private Sub TreeView1_NodeClick(ByVal Node As ComctlLib.Node)
MsgBox Node.Text
End Sub

回答(3):

右键悟性里打个有个坐标系统的,就是第几行,第几列的