1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > Winform 窗体淡出淡入效果

Winform 窗体淡出淡入效果

时间:2023-10-23 13:27:01

相关推荐

Winform 窗体淡出淡入效果

using System;

using System.Windows.Forms;

using System.Runtime.InteropServices;//窗体效果需要该包

namespace 软件项目管理系统

{

public partial class LoginForm : Form

{

//窗体弹出或消失效果

[DllImport("user32.dll", EntryPoint = "AnimateWindow")]

private static extern bool AnimateWindow(IntPtr handle, int ms, int flags);

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;

public LoginForm()

{

InitializeComponent();

//窗体弹出效果

AnimateWindow(this.Handle, 300, AW_CENTER);

}

//“关闭按钮”事件

private void button1_Click(object sender, EventArgs e)

{

//窗体弹出效果

AnimateWindow(this.Handle, 300, AW_HIDE + AW_CENTER);

Application.Exit();

}

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。