如何实现动画显示窗口

来源:互联网 发布:淘宝大学总裁班有用吗 编辑:程序博客网 时间:2024/05/18 08:30

  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);
        }
      
    }

原创粉丝点击