WinForm------窗体初始化位置的显示

在窗体的构造方法里面添加

public Form2()
{
  InitializeComponent();

   //指定窗口初始化时的位置(计算机屏幕中间)
   this.StartPosition = FormStartPosition.CenterScreen;

 

   //指定窗口初始化时的位置,如果为Manual,位置由Location决定(计算机屏幕中间,如果不/2,则计算机右下角)
   this.StartPosition = FormStartPosition.Manual;
    this.Location = new Point((Screen.PrimaryScreen.WorkingArea.Width - this.Width)/2, (Screen.PrimaryScreen.WorkingArea.Height - this.Height)/2)

}

原文地址:https://www.cnblogs.com/tianhengblogs/p/5717355.html