C# winform窗体在桌面右下角显示(任务栏上方)


问题描述:

有一个主窗口程序,需要给该程序添加一个通知子窗口。子窗口的位置为右下角。

解决方法:

在子窗口frmPopMsg的代码文件中添加如下代码:

public frmPopMsg()
        {
            InitializeComponent();
            
            int x = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Width -this.Width;
            int y = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Height -this.Height;
            Point p = new Point(x, y);
            this.PointToScreen(p);
            this.Location = p;
        }


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM