源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

C# 动画窗体(AnimateWindow)的小例子

  • 时间:2020-02-13 16:23 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:C# 动画窗体(AnimateWindow)的小例子
[u]复制代码[/u] 代码如下:
using System; using System.Runtime.InteropServices; using System.Windows.Forms; namespace WinFormTitle {     public partial class FormTitle : Form     {         [DllImport("user32.dll", EntryPoint = "AnimateWindow")]         private static extern bool AnimateWindow(IntPtr handle, int ms, int flags);         public FormTitle()         {             InitializeComponent();             this.StartPosition = FormStartPosition.CenterScreen;         }         protected override void OnLoad(EventArgs e)         {             base.OnLoad(e);             AnimateWindow(this.Handle, 1000, 0x20010);   // 居中逐渐显示。             //AnimateWindow(this.Handle, 1000, 0xA0000); // 淡入淡出效果。             //AnimateWindow(this.Handle, 1000, 0x60004); // 自上向下。             //AnimateWindow(this.Handle, 1000, 0x20004); // 自上向下。         }         protected override void OnFormClosing(FormClosingEventArgs e)         {             base.OnFormClosing(e);             AnimateWindow(this.Handle, 1000, 0x10010);    // 居中逐渐隐藏。             //AnimateWindow(this.Handle, 1000, 0x90000); // 淡入淡出效果。             //AnimateWindow(this.Handle, 1000, 0x50008); // 自下而上。             //AnimateWindow(this.Handle, 1000, 0x10008); // 自下而上。         }     } }
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部