C# 桌面右下角显示窗体

我怕爱的太早我们不能终老 提交于 2020-02-04 14:40:36

 

        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;      //设置窗体位置
        }

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!