private void ReSize(int x, int y)
{
//if (x==0 && y==0)
// return;
SuspendLayout();
int xx = Vertical.Left - x;
int yy = Horizontal.Top - y;
if (xx < 0)
xx = 0;
if (yy < 0)
yy = 0;
if (yy > Height - Horizontal.Height - SystemInformation.VerticalScrollBarWidth*3)
yy = Height - Horizontal.Height - SystemInformation.VerticalScrollBarWidth*3;
if (xx > Width - Vertical.Width - SystemInformation.VerticalScrollBarWidth*3)
xx = Width - Vertical.Width - SystemInformation.VerticalScrollBarWidth*3;
if (xx != Vertical.Left)
Vertical.Left = xx;
if (yy != Horizontal.Top)
Horizontal.Top = yy;
int CenterY = (Horizontal.Top + Horizontal.Height/2) - Center.Height/2;
int CenterX = (Vertical.Left + Vertical.Width/2) - Center.Width/2;
Center.Location = new Point(CenterX, CenterY);
ResumeLayout();
Invalidate();
try
{
if (UpperLeft != null)
UpperLeft.Refresh();
if (UpperLeft != null)
UpperLeft.Refresh();
if (UpperLeft != null)
UpperLeft.Refresh();
if (UpperLeft != null)
UpperLeft.Refresh();
}
catch {}
OnResizing();
//DoResize();
//this.Refresh ();
}