H
HaySeed
I have a Panel which is being used as a paint surface. When the user presses
the up/down arrows or Page Up/ Down buttons I would like to scroll the panel
according to the proper increment.
Questions:
1) How do I get a handle to the AutoScroll Scrollbars when they are visible?
2) How do I increment the scrollbar (N) pixels down the panel?
I have tried the following Win32 call -
private const int WM_HSCROLL = 276;
private const int WM_VSCROLL = 277;
private const int SB_LINEUP = 0;
private const int SB_LINEDOWN = 1;
private const int SB_PAGEUP = 2;
private const int SB_PAGEDOWN = 3;
private const int SB_PAGETOP = 6;
private const int SB_PAGEBOTTOM = 7;
private const int SB_ENDSCROLL = 8;
SendMessage(panel.Handle, WM_VSCROLL, (IntPtr)SB_LINEDOWN,
IntPtr.Zero);
This does jump the scroll bar as needed but I could not find how to control
the distances the scrollbar would travel for a Line/Page/Top/Bottom etc.
Any thoughts would be appreciated.
the up/down arrows or Page Up/ Down buttons I would like to scroll the panel
according to the proper increment.
Questions:
1) How do I get a handle to the AutoScroll Scrollbars when they are visible?
2) How do I increment the scrollbar (N) pixels down the panel?
I have tried the following Win32 call -
private const int WM_HSCROLL = 276;
private const int WM_VSCROLL = 277;
private const int SB_LINEUP = 0;
private const int SB_LINEDOWN = 1;
private const int SB_PAGEUP = 2;
private const int SB_PAGEDOWN = 3;
private const int SB_PAGETOP = 6;
private const int SB_PAGEBOTTOM = 7;
private const int SB_ENDSCROLL = 8;
SendMessage(panel.Handle, WM_VSCROLL, (IntPtr)SB_LINEDOWN,
IntPtr.Zero);
This does jump the scroll bar as needed but I could not find how to control
the distances the scrollbar would travel for a Line/Page/Top/Bottom etc.
Any thoughts would be appreciated.