2012年(101)
分类: 嵌入式
2012-06-12 23:29:19
1.获取当前屏幕显示区域大小,不包含任务栏. 即任务栏以上的宽度和高度
Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height
2.获取当前屏幕大小,包括任务栏.
Screen.PrimaryScreen.Bounds.Width ,Screen.PrimaryScreen.Bounds.Height
3.将窗口定位到右下角方法。
this.Location = new Point(Screen.PrimaryScreen.Bounds.Width - this.Size.Width, Screen.PrimaryScreen.WorkingArea.Height - this.Size.Height);
注意高度必须用workingarea,要不然任务栏会遮盖住窗口下面部分。
this.Location = new Point(Screen.PrimaryScreen.Bounds.Width - this.Size.Width, Screen.PrimaryScreen.Bounds.Height - this.Size.Height );