-
using System.Runtime.InteropServices;
-
public partial class Form2 : Form
-
{
-
public Form2()
-
{
-
InitializeComponent();
-
}
-
[DllImport("user32")]
-
private static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags);
-
private static int AW_HIDE = 0x00010000;//该变量表示动画隐藏窗体
-
private static int AW_SLIDE = 0x00040000;//该变量表示出现滑行效果的窗体
-
private static int AW_VER_NEGATIVE = 0x00000008;//该变量表示从下向上开屏
-
private static int AW_VER_POSITIVE = 0x00000004;//该变量表示从上向下开屏
-
private const int AW_ACTIVE = 0x20000;//激活窗口
-
private const int AW_BLEND = 0x80000;//应用淡入淡出结果
-
private void Form2_Load(object sender, EventArgs e)
-
{
-
int x = Screen.PrimaryScreen.WorkingArea.Right - this.Width;
-
int y = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height;
-
this.Location = new Point(x, y);//设置窗体在屏幕右下角显示
-
AnimateWindow(this.Handle, 1000, AW_SLIDE | AW_ACTIVE | AW_VER_NEGATIVE);
-
}
-
//弹窗关闭
-
private void simpleButton2_Click(object sender, EventArgs e)
-
{
-
AnimateWindow(this.Handle, 1000, AW_BLEND | AW_HIDE);
-
}
-
}
01-26
9546
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交