winform下如何实现右下角弹窗效果

[DllImport("user32")]
private static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags);
private const int AW_HIDE = 0x10000;//隐藏窗口
private const int AW_ACTIVE = 0x20000;//激活窗口,在使用了AW_HIDE标志后不要使用这个标志
private const int AW_BLEND = 0x80000;//使用淡入淡出效果

public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
int x = Screen.PrimaryScreen.WorkingArea.Right - this.Width;
int y = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height;
this.Location = new Point(x, y);
AnimateWindow(this.Handle, 1000, AW_ACTIVE);
this.FormClosing += (a, b) => { AnimateWindow(this.Handle, 1000, AW_BLEND | AW_HIDE); };
}

上一篇:Python之定义类并创建实例


下一篇:函数