How to center a window in a WinForms application using C#

1 Answer

0 votes
namespace WinFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            this.StartPosition = FormStartPosition.CenterScreen;
        }
    }
}



/*
run:
 

 
*/

 



answered Apr 2 by avibootz
...