есть Listview как report
как определить по какому subitemу в строке был клик???
Dim dblclk As Boolean
Private Sub FirmList_DblClick()
dblclk = True
End Sub
Private Sub FirmList_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If dblclk = True Then
dblclk = False
Select Case x
Case Is < 2800
Call DblCkick(0)
Case 2800 To 2800 + 1666
Call DblCkick(1)
Case 2800 + 1667 To 2800 + 1667 + 1667
Call DblCkick(2)
Case 2800 + 1667 + 1666 To 2800 + 1667 + 1667 + 1667
Call DblCkick(3)
End Select
End If
End Sub
Dim dblclk As Boolean
Private Sub FirmList_DblClick()
dblclk = True
End Sub
Private Sub FirmList_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If dblclk = True Then
dblclk = False
Select Case x
Case Is < FirmList.ColumnHeaders(1).Width + FirmList.ColumnHeaders(2).Width
Call DblCkick(0)
Case FirmList.ColumnHeaders(1).Width + FirmList.ColumnHeaders(2).Width To FirmList.ColumnHeaders(1).Width + FirmList.ColumnHeaders(2).Width + FirmList.ColumnHeaders(3).Width
Call DblCkick(1)
Case FirmList.ColumnHeaders(1).Width + FirmList.ColumnHeaders(2).Width + FirmList.ColumnHeaders(3).Width To FirmList.ColumnHeaders(1).Width + FirmList.ColumnHeaders(2).Width + FirmList.ColumnHeaders(3).Width + FirmList.ColumnHeaders(4).Width
Call DblCkick(2)
Case FirmList.ColumnHeaders(1).Width + FirmList.ColumnHeaders(2).Width + FirmList.ColumnHeaders(3).Width + FirmList.ColumnHeaders(4).Width To FirmList.ColumnHeaders(1).Width + FirmList.ColumnHeaders(2).Width + FirmList.ColumnHeaders(3).Width + FirmList.ColumnHeaders(4).Width + FirmList.ColumnHeaders(5).Width
Call DblCkick(3)
End Select
End If
End Sub
Dim dblclk As Boolean
Private Sub FirmList_DblClick()
dblclk = True
End Sub
Private Sub FirmList_MouseUp(Button As Integer, Shift As Integer, X As Single, y As Single)
Dim colum As ColumnHeader
If dblclk = True Then
dblclk = False
For Each colum In FirmList.ColumnHeaders
If X > colum.Left And X < colum.Left + colum.Width Then
MsgBox "SubIttem = " & colum.SubItemIndex
Exit For
End If
Next
End If
End Sub
Сейчас этот форум просматривают: Google-бот и гости: 173