WPF窗體居中顯示


            {
                //此程序實現窗體居中顯示 
                Window1 myWindow1 = new Window1();
                double screeHeight = SystemParameters.FullPrimaryScreenHeight;
                double screeWidth = SystemParameters.FullPrimaryScreenWidth;
                myWindow1.Top = (screeHeight - this.Height) / 2;
                myWindow1.Left = (screeWidth - this.Height) / 2;
                myWindow1.Show();
            }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章