private void UpdatePictureBoxPositon() { pictureBox.Location = new System.Drawing.Point( (mainPanel.Width - pictureBox.Width) / 2, (mainPanel.Height - pictureBox.Height) / 2); }