C#设置窗体打开位置(在显示器的右下角打开)
2009-01-09 15:39
246 查看
假设窗体的大小为200×120,在显示起的右下角打开。
int x= System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Width - 200;
int y=System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Height - 125;
this.SetDesktopLocation(x,y);
注释:
System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Width; //当前显示器的宽度
System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Height; //当前显示器的高度
this.SetDesktopLocation(x,y); //设置窗体打开后在显示器上的坐标
int x= System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Width - 200;
int y=System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Height - 125;
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#设置窗体打开位置(在显示器的右下角打开)
- C#WinForm中怎么设置窗体不可以拉大和拖动,不可以拖动窗体的位置,让他固定不动啊?
- c# winform 窗体起始位置 设置
- C# 设置Windows 窗体的屏幕位置,动态创建的Form
- c# winform 窗体起始位置 设置
- 1、怎样设置C#OpenFileDialog(文件选择窗体)的指定路径、文件格式等属性(设置打开默认路径、文件格式、窗体显示文本)
- C#(winform)设置窗体的启动位置
- C#中..怎么设置一个窗口打开进在屏幕中出现的位置..
- c#设置窗体在显示器居中显示
- 设置窗体的起始位置,并检查配置文件是否存在,存在使用配置文件,不存在创建配置文件,在每次打开窗体时保持窗体上一次关闭的位置。
- C#窗体位置与大小设置详解
- C#-设置窗体在显示器居中显示
- C#代码设置窗体和Panel的位置大小
- WindowsForm C# 窗体位置设置(StartPosition属性)
- c# 窗体位置设置
- c# 设置窗体位置
- c#创建窗体,向窗体添加控件,设置控件大小位置等属性,写控件的响应
- c#设置窗体在显示器居中显示
- C#中实现窗体第二次打开时,在原来第一次关闭的位置,类似于QQ面板