I have a MDI Parent (Form1) and a MDI Child (Form2). I have currently disabled scroll bars for Form1 when Form2 goes past the bounds of Form1 by placing the following code within Form2:
protected override void WndProc(ref Message m)
{
const int WM_MOVE = 0x0003;
switch (m.Msg)
{
case WM_MOVE:
return;
default:
base.WndProc(ref m);
break;
}
}
While the scroll bars for Form1 will not show if Form2 goes out of bounds when the user drags Form2 out of Form1's bounds. It will however show the scroll bars if the user resizes Form1 to where Form2 goes out of bounds.
How can I fix it so that this does not occur