問題描述:
有一個主窗口程序,需要給該程序添加一個通知子窗口。子窗口的位置為右下角。
解決方法:
在子窗口
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;
}