System.Windows.Forms.ControlHelper.ToCenter C# (CSharp) Méthode

ToCenter() public static méthode

public static ToCenter ( this f ) : void
f this
Résultat void
        public static void ToCenter(this Form f)
        {
            f.Location = new Point(
                (Screen.PrimaryScreen.WorkingArea.Width - f.Width) / 2,
                (Screen.PrimaryScreen.WorkingArea.Height - f.Height) / 2
                );
        }