手机
当前位置:查字典教程网 >编程开发 >C#教程 >C# 动画窗体(AnimateWindow)的小例子
C# 动画窗体(AnimateWindow)的小例子
摘要:复制代码代码如下:usingSystem;usingSystem.Runtime.InteropServices;usingSystem.W...

复制代码 代码如下:

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); // 自下而上。

}

}

}

【C# 动画窗体(AnimateWindow)的小例子】相关文章:

WinForm下 TextBox只允许输入数字的小例子

c#动态调用Webservice的两种方法实例

c# 关闭窗体时提示的小例子

C# 调用C++写的dll的实现方法

将DLL放入到资源中,运行时自动加载的小例子

设置C#窗体程序只能启动一次

C# 手动/自动保存图片的实例代码

C# Bitmap 复制的小例子

c# 生成随机时间的小例子

c#使用linq技术创建xml文件的小例子

精品推荐
分类导航