This doesn't scroll any picture controls or scrollbars on your form, so you need to change
VB Code:
If Not (TypeOf MyControl Is VScrollBar) And _ Not (TypeOf MyControl Is PictureBox) And _ Not (TypeOf MyControl Is HScrollBar) Then
To
VB Code:
If Not (MyControl.hwnd = VScroll1.hwnd) And _ Not (MyControl.hwnd = Picture1.hwnd) And _ Not (MyControl.hwnd = HScroll1.hwnd) Then
but i still reckon using subclassing to handle the WM_VSCROLL and WM_HSCROLL messages and setting the window styles WS_HSCROLL and WS_VSCROLL as above is a bit neater...
HTH,
Duncan




Reply With Quote