Try this
private const int WM_VSCROLL = 0x115;
private const int SB_LINEDOWN = 1;
private const int SB_PAGEUP= 2;
private const int SB_PAGEDOWN= 3;
private const int SB_THUMBPOSITION= 4;
private const int SB_THUMBTRACK= 5;
private const int SB_TOP= 6;
private const int SB_BOTTOM = 7;
private const int SB_ENDSCROLL = 8;
[DllImport("user32.dll")]
private static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam,
IntPtr lParam);
// use the constant values based on the functionality
SendMessage(panel1.Handle, WM_VSCROLL, (IntPtr) SB_LINEDOWN , IntPtr.Zero);
--
Shak
(Houston)
"Raymond Dynowski" <de***@tesco.net> wrote in message
news:dV_Dc.103$7I6.72@newsfe1-win...
How do you force a panel to scroll in code.
I have a large picture box inside my panel.
I would like the panel to default to the centre of the screen, rather than
the scrollbars showing the top left corner
Thanks
Ray