C# 仿QQ右下角消息框
方法1:
//点击帮助菜单项出现消息框
private void 帮助ToolStripMenuItem_Click(object sender, EventArgs e)
{
frmNotices f = new frmNotices();//定义消息框的一个对象
Point p = new Point(Screen.PrimaryScreen.WorkingArea.Width-f.Width, Screen.PrimaryScreen.WorkingArea.Height);
f.PointToScreen(p);
f.Location = p;
f.Show();
for (int i = 0; i <= f.Height; i++)
{
f.Location = new Point(p.X, p.Y - i);
}
}
使用时适当的改动就可以了。
方法2:
//让窗体显示在右下角
Screen screen = Screen.AllScreens[0];
this.DesktopLocation = new Point(screen.Bounds.Width - (this.Width + 5), screen.Bounds.Height - this.Height + 33));
//让窗体一直显示在最前面
this.TopMost = true;
另外,还有其他方法,碰到再综合吧。
浙公网安备 33010602011771号