天天看點

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();

            }

繼續閱讀