现在的位置: 首页 > 综合 > 正文

如何实现动画显示窗口

2013年12月05日 ⁄ 综合 ⁄ 共 856字 ⁄ 字号 评论关闭

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

抱歉!评论已关闭.