黄聪:C#设置窗体打开位置(在显示器的右下角打开)
2015-10-06 14:26
369 查看
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#实现的等额本息法、按月付息到期还本法、一次性还本付息法
- 有关c# update access时提示至少一个参数没有被指定值
- C#里面Console.Write()和Console.WriteLine()有什么区别?
- C#中Console.ReadLine()和Console.Read()有何区别?
- C#中使用DES和AES加密解密
- C#实现DES加密解密,AES加密解密
- C#表达式及其组成
- C#-利用NOPI处理Excel的代码
- 关于C#中params关键字的作用及用法
- C#-项目属性设置
- 【c#】运算符
- c# 事件学习
- 【转载】C#中的“托管”和“非托管”
- 任意多边形切割/裁剪(附C#代码实现)
- C#学习日记13---类(Class)的声明与定义
- C#删除和清空文件夹的程序
- 【C#】C#中的面对对象
- C#--分部方法
- C# 写简单配置文件插件 SharpConfig 用法
- C#--索引