Prima aggiungi il controllo MouseWheelCatcher.ocx
poi scrivi questo che ti metto ora, ma bada che devo migliorarlo in quanto se arrivi all'ultima riga si blocca, e sulla prima da un brutto effetto grafico.
codice:
Private Sub WheelCatcher_WheelRotation(Rotation As Long, x As Long, y As Long, CtrlHwnd As Long)
If MIA_FLEX.Rows <> MIA_FLEX.Row + 1 Then
If MIA_FLEX.Row = 0 Then
With MIA_FLEX
.Row = .Row + 1
.RowSel = .Row
.ColSel = .Cols - 1
If .RowIsVisible(.Row) = False Then .TopRow = .Row
.SetFocus
End With
Else
If MIA_FLEX.Rows = MIA_FLEX.Row + 1 Then
With MIA_FLEX
.Row = .Row - 1
.RowSel = .Row
.ColSel = .Cols - 1
If .RowIsVisible(.Row) = False Then .TopRow = .Row
.SetFocus
End With
Else
With MIA_FLEX
.Row = .Row - Rotation
.RowSel = .Row
.ColSel = .Cols - 1
If .RowIsVisible(.Row) = False Then .TopRow = .Row
.SetFocus
End With
End If
End If
End If
End Sub