1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| Private Sub Wheel1_WheelRotate(ctrl As Object, Delta As Long, X As Long, Y As Long)
Dim CtrlIndex As String
Dim CtrlName As String
'
On Error Resume Next
'
CtrlIndex = CStr(ctrl.Index)
'
On Error GoTo 0
'
If CtrlIndex = "" Then
CtrlName = ctrl.Name
Else
CtrlName = ctrl.Name & "(" & CtrlIndex & ")"
End If
'
If ctrl.Name = "Grid1" Then
'
If Delta > 0 Then
If ctrl.TopRow < ctrl.Rows Then
ctrl.TopRow = ctrl.TopRow + 1
End If
Else
If ctrl.TopRow > 0 Then
ctrl.TopRow = ctrl.TopRow - 1
End If
End If
'
End If
'
Debug.Print CtrlName, Delta, X, Y
'
End Sub |
Partager