04 |
[DllImportAttribute( "user32.dll" )]
|
05 |
private static extern bool AnimateWindow(IntPtr whnd, int dwtime, int dwflag);
|
19 |
public const Int32 AW_HOR_POSITIVE = 0x00000001;
|
20 |
public const Int32 AW_HOR_NEGATIVE = 0x00000002;
|
21 |
public const Int32 AW_VER_POSITIVE = 0x00000004;
|
22 |
public const Int32 AW_VER_NEGATIVE = 0x00000008;
|
23 |
public const Int32 AW_CENTER = 0x00000010;
|
24 |
public const Int32 AW_HIDE = 0x00010000;
|
25 |
public const Int32 AW_ACTIVATE = 0x00020000;
|
26 |
public const Int32 AW_SLIDE = 0x00040000;
|
27 |
public const Int32 AW_BLEND = 0x00080000;
|
34 |
public static void HideFXCenter(IntPtr wnd, int dwtime)
|
36 |
AnimateWindow(wnd, dwtime, AW_CENTER | AW_HIDE | AW_SLIDE);
|
调用方法
启动效果: 在窗体加载事件里面加上
1 |
AnimateWindow( this .Handle, 800, AW_SLIDE + AW_CENTER);
|
关闭效果: 在窗体关闭的事件里加上
1 |
HideFXCenter( this .Handle, 400);
|
声明: 本文由(孤狼)原创编译,转载请保留链接: C# 仿金山毒霸启动和关闭淡入淡出效果