and the fix is:only change the PictureBox case in the sub, keep the rest of the loop the same.VB Code:
Public Sub MouseWheel(ByVal MouseKeys As Long, ByVal Rotation As Long, ByVal Xpos As Long, ByVal Ypos As Long) Dim ctl As Control, cContainerCtl As Control Dim bHandled As Boolean Dim bOver As Boolean For Each ctl In Controls ' ' ' change this case Case TypeOf ctl Is PictureBox, TypeOf ctl Is Frame Set cContainerCtl = ctl: bHandled = False ' ' Next ctl If Not cContainerCtl Is Nothing Then If TypeOf cContainerCtl Is PictureBox Then PictureBoxZoom cContainerCtl, MouseKeys, Rotation, Xpos, Ypos Else ' Scroll was not handled by any controls, so treat as a general message send to the form Me.Caption = "Form Scroll " & IIf(Rotation < 0, "Down", "Up") End If End Sub




Reply With Quote