首页 > Windows开发 > 详细

黄聪:C#设置窗体打开位置(在显示器的右下角打开)

时间:2015-10-06 15:24:36      阅读:384      评论:0      收藏:0      [点我收藏+]

 

            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); //设置窗体打开后在显示器上的坐标

黄聪:C#设置窗体打开位置(在显示器的右下角打开)

原文:http://www.cnblogs.com/huangcong/p/4857100.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!