Code: Select all
panel2.Location = new Point(panel1.Width / 2 - panel2.Width / 2,panel1.Height / 2 - panel2.Height / 2);
The AutoScroll works for when panel2's X or Y is greater than panel1's Width or Height, But when panel2's location is -100,-100, Half of panel2 is cut off.
That might be really confusing.
Soo, Basically the auto scroll works perfect when panel2 is smaller than panel1 but when panel2 is bigger than panel1 panel2's center is in the corner so all I see is everything from the center all the way down and the center all the way to the right, lol CONFUSING.
Oh well, If you can help that would be great!