public partial class Form1 : Form
{
[DllImport("user32.dll")]
private static extern bool AnimateWindow(IntPtr hend, int dwTime, int dwFlags);
private const int AW_HOR_POSITIVE = 0x00000001;
private const int AW_HOR_NEGATIVE = 0x00000002;
private const int AW_VER_POSITIVE = 0x00000004;
private const int AW_VER_NEGATIVE = 0x00000008;
private const int AW_CENTER = 0x00000010;
private const int AW_HIDE = 0x00010000;
private const int AW_ACTIVATE = 0x00020000;
private const int AW_SLIDE = 0x00040000;
private const int AW_BLEMD = 0x00080000;
public Form1()
{
InitializeComponent();
AnimateWindow(this.Handle, 500, AW_SLIDE + AW_VER_NEGATIVE);
}
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
AnimateWindow(this.Handle, 500, AW_SLIDE + AW_VER_NEGATIVE+AW_HIDE);
}
}
如何实现动画显示窗口
最新推荐文章于 2022-02-16 10:54:32 发布