C#每天抄一点(3):利用API实现窗口动画
06 Oct 2011上一篇的窗口动画是利用Timer控件实现的效果,今天这个是利用API实现。
API 部分:
public const Int32 AW_HOR_POSITIVE = x00000001; //自左向右显示窗体
public const Int32 AW_HOR_NEGATIVE = x00000002; //自右向左显示窗体
public const Int32 AW_VER_POSITIVE = x00000004; //自上而下显示窗体
public const Int32 AW_VER_NEGATIVE = x00000008; //自下而上显示窗体
public const Int32 AW_CENTER = x00000010; //窗体向外扩展
public const Int32 AW_HIDE = x00010000; //隐藏窗体
public const Int32 AW_ACTIVATE = x00020000; //激活窗体
public const Int32 AW_SLIDE = x00040000; //使用滚动动画类型
public const Int32 AW_BLEND = x00080000; //使用淡入效果
//声明AnimateWindow函数
[System.Runtime.InteropServices.DllImportAttribute("user32.dll")]
private static extern bool AnimateWindow(IntPtr hwnd,int dwTime,int dwFlags);
public const Int32 AW_HOR_NEGATIVE = x00000002; //自右向左显示窗体
public const Int32 AW_VER_POSITIVE = x00000004; //自上而下显示窗体
public const Int32 AW_VER_NEGATIVE = x00000008; //自下而上显示窗体
public const Int32 AW_CENTER = x00000010; //窗体向外扩展
public const Int32 AW_HIDE = x00010000; //隐藏窗体
public const Int32 AW_ACTIVATE = x00020000; //激活窗体
public const Int32 AW_SLIDE = x00040000; //使用滚动动画类型
public const Int32 AW_BLEND = x00080000; //使用淡入效果
//声明AnimateWindow函数
[System.Runtime.InteropServices.DllImportAttribute("user32.dll")]
private static extern bool AnimateWindow(IntPtr hwnd,int dwTime,int dwFlags);
转载请注明:于哲的博客 » C#每天抄一点(3):利用API实现窗口动画