本文实例报告了C# winform完成右下角弹出窗口效果的要领。分享给人人供人人参考,细致以下:
using System.Runtime.InteropServices; [DllImport("user32")] private static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags); //下面是可用的常量,根据分歧的动画效果声明自身需要的 private const int AW_HOR_POSITIVE = 0 x0001;//自左向右显现窗口,该标记能够在迁徙改变动画和滑动动画中运用。运用AW_CENTER标记时无视该标记 private const int AW_HOR_NEGATIVE = 0 x0002;//自右向左显现窗口,该标记能够在迁徙改变动画和滑动动画中运用。运用AW_CENTER标记时无视该标记 private const int AW_VER_POSITIVE = 0 x0004;//自顶向下显现窗口,该标记能够在迁徙改变动画和滑动动画中运用。运用AW_CENTER标记时无视该标记 private const int AW_VER_NEGATIVE = 0 x0008;//自下向上显现窗口,该标记能够在迁徙改变动画和滑动动画中运用。运用AW_CENTER标记时无视该标记该标记 private const int AW_CENTER = 0 x0010;//若运用了AW_HIDE标记,则使窗口向内堆叠;不然向外扩展 private const int AW_HIDE = 0 x10000;//隐藏窗口 private const int AW_ACTIVE = 0 x20000;//激活窗口,在运用了AW_HIDE标记后不要运用这个标记 private const int AW_SLIDE = 0 x40000;//运用滑动范例动画效果,默以为迁徙改变动画范例,当运用AW_CENTER标记时,这个标记就被无视 private const int AW_BLEND = 0 x80000;//运用淡入淡出效果 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_SLIDE | AW_ACTIVE | AW_VER_NEGATIVE); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { AnimateWindow(this.Handle, 1000, AW_BLEND | AW_HIDE); }
以上就是关于C#winform怎样完成右下角弹出窗口效果的要领分享的细致内容,更多请关注ki4网别的相干文章!