private void UpdatePosition()
{
if ((autosize) && (this.Dock != DockStyle.Fill) && (this.Parent != null))
{
Rectangle rc = this.Parent.ClientRectangle;
int width = frameSize.Width;
int height = frameSize.Height;
// update controls size and location
this.SuspendLayout();
this.Location = new Point((rc.Width - width - 2) / 2, (rc.Height - height - 2) / 2);
this.Size = new Size(width + 2, height + 2);
this.ResumeLayout();
}
}