Private Sub ListView1_DblClick()
Debug.Print "coluna " & Colun & " Linha " & Linha
End Sub
Private Sub listview1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim col As Integer
col = ColunaLV(x, y, ListView1)
If col > 1 And col <> 0 Then
MsgBox lv.SelectedItem.SubItems(col - 1)
Label1.Caption = "Coluna " & col
Label2.Caption = "valor " & ListView1.SelectedItem.SubItems(col - 1)
ElseIf col = 1 Then
MsgBox lv.SelectedItem.Text
Label1.Caption = "Coluna " & col
Label2.Caption = "valor " & ListView1.SelectedItem.Text
End If
Colun = col
Linha = ListView1.SelectedItem.Index
End Sub
Private Function ColunaLV(ByVal x As Long, ByVal y As Long, ByVal NameLv As ListView) As Integer
Dim I As Long
For I = 1 To NameLv.ColumnHeaders.Count
If x >= NameLv.ColumnHeaders(I).Left And x < (NameLv.ColumnHeaders(I).Left + NameLv.ColumnHeaders(I).Width) Then
ColunaLV = I
Exit For
End If
Next
End Function
acho que ajuda!