C# 桌面右下角显示窗体

 

        public Form1()
        {
            InitializeComponent();
            //桌面窗口区宽减自身宽,高减自身高
            int x = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Width - this.Size.Width;         
            int y = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Height - this.Size.Height;  
            Point p = new Point(x, y);
            this.PointToScreen(p);  //区域坐标变换成屏幕坐标表示
            this.Location = p;      //设置窗体位置
        }

 

posted @ 2020-02-04 13:54  编码的奥秘  阅读(298)  评论(0编辑  收藏  举报