//1、在屏幕的右下角顯示窗體 //這個區域不包括任務欄的 Rectangle ScreenArea = System.Windows.Forms.Screen.GetWorkingArea(this); //這個區域包括任務欄,就是屏幕顯示的物理范圍 Rectangle ScreenArea = System.Windows.Forms.Screen.GetBounds(this); int width1 = ScreenArea.Width; //屏幕寬度 int height1 = ScreenArea.Height; //屏幕高度 this.Location = new System.Drawing.Point(width1 - 窗體寬度, height1 - 窗體高度); //指定窗體顯示在右下角 //2、在母窗體的中間顯示子窗體的位置計算 waitForm.Location = new Point((this.Location.X + (this.Width - waitForm.Width) / 2), (this.Location.Y + (this.Height - waitForm.Height) / 2));Web下:System.Web.HttpBrowserCapabilities hbc=new System.Web.HttpBrowserCapabilities();
Demo
Rectangle ScreenArea = Screen.GetWorkingArea(this);
this.Size = new Size(100,ScreenArea.Height);//設置為屏幕高度
