Available in the LEADTOOLS Imaging toolkit. |
MouseWheel (Main Control) example for Visual Basic
Private Sub Form_Load()
LEAD1.Load "c:\1.bmp", 0, 0, 1
LEAD1.EnableMouseWheel = True
End Sub
Private Sub LEAD1_MouseWheel(ByVal nDelta As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
If (Shift = 2) Then ‘CTRL Key
If (nDelta < 0) Then
If (LEAD1.PaintZoomFactor < 100 * 16) Then
LEAD1.PaintZoomFactor = LEAD1.PaintZoomFactor * 2
End If
Else
If (LEAD1.PaintZoomFactor > 100 / 16) Then
LEAD1.PaintZoomFactor = LEAD1.PaintZoomFactor / 2
End If
End If
Else
LEAD1.VScrollInfo.Pos = LEAD1.VScrollInfo.Pos – nDelta
End If
End Sub