System.Windows.Forms.ControlHelper.ToCenter C# (CSharp) Method

ToCenter() public static method

public static ToCenter ( this f ) : void
f this
return 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
                );
        }