当前位置: 移动技术网 > IT编程>开发语言>.net > (转)winform Form 淡入淡出效果

(转)winform Form 淡入淡出效果

2019年05月23日  | 移动技术网IT编程  | 我要评论

隔世离空的红颜简谱,orz,两天一夜111218

原文地址:http://blog.csdn.net/a237428367/article/details/5933565

using system.runtime.interopservices; public class win32 { public const int32 aw_hor_positive = 0x00000001; // 从左到右打开窗口 public const int32 aw_hor_negative = 0x00000002; // 从右到左打开窗口 public const int32 aw_ver_positive = 0x00000004; // 从上到下打开窗口 public const int32 aw_ver_negative = 0x00000008; // 从下到上打开窗口 public const int32 aw_center = 0x00000010; public const int32 aw_hide = 0x00010000; // 在窗体卸载时若想使用本函数就得加上此常量 public const int32 aw_activate = 0x00020000; //在窗体通过本函数打开后,默认情况下会失去焦点,除非加上本常量 public const int32 aw_slide = 0x00040000; public const int32 aw_blend = 0x00080000; // 淡入淡出效果 [dllimport("user32.dll", charset = charset.auto)] public static extern bool animatewindow( intptr hwnd, // handle to window int dwtime, // duration of animation int dwflags // animation type ); } /*淡入窗体*/ private void form_load(object sender, eventargs e) { win32.animatewindow(this.handle, 2000, win32.aw_blend); } /*淡出窗体*/ private void form_formclosing(object sender, formclosingeventargs e) { win32.animatewindow(this.handle, 2000, win32.aw_slide | win32.aw_hide | win32.aw_blend); }

  

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网