int x = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Width - this.Size.Width - 5; int y = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Height - this.Size.Height - 5; this.SetDesktopLocation(x, y);
注释:
System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Width; //当前显示器的宽度
System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Height; //当前显示器的高度
this.SetDesktopLocation(x,y); //设置窗体打开后在显示器上的坐标
本文转自黄聪博客园博客,原文链接:http://www.cnblogs.com/huangcong/p/4857100.html,如需转载请自行联系原作者