当前位置: 移动技术网 > IT编程>开发语言>c# > C# winform实现右下角弹出窗口结果的方法

C# winform实现右下角弹出窗口结果的方法

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

本文实例讲述了c# winform实现右下角弹出窗口结果的方法。分享给大家供大家参考,具体如下:

using system.runtime.interopservices;
[dllimport("user32")]
private static extern bool animatewindow(intptr hwnd, int dwtime, int dwflags);
//下面是可用的常量,按照不合的动画结果声明本身须要的
private const int aw_hor_positive = 0 x0001;//自左向右显示窗口,该标记可以在迁移转变动画和滑动动画中应用。应用aw_center标记时忽视该标记
private const int aw_hor_negative = 0 x0002;//自右向左显示窗口,该标记可以在迁移转变动画和滑动动画中应用。应用aw_center标记时忽视该标记
private const int aw_ver_positive = 0 x0004;//自顶向下显示窗口,该标记可以在迁移转变动画和滑动动画中应用。应用aw_center标记时忽视该标记
private const int aw_ver_negative = 0 x0008;//自下向上显示窗口,该标记可以在迁移转变动画和滑动动画中应用。应用aw_center标记时忽视该标记该标记
private const int aw_center = 0 x0010;//若应用了aw_hide标记,则使窗口向内重叠;不然向外扩大
private const int aw_hide = 0 x10000;//隐蔽窗口
private const int aw_active = 0 x20000;//激活窗口,在应用了aw_hide标记后不要应用这个标记
private const int aw_slide = 0 x40000;//应用滑动类型动画结果,默认为迁移转变动画类型,当应用aw_center标记时,这个标记就被忽视
private const int aw_blend = 0 x80000;//应用淡入淡出结果
private void form1_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 form1_formclosing(object sender, formclosingeventargs e)
{
  animatewindow(this.handle, 1000, aw_blend | aw_hide);
}

更多关于c#相关内容感兴趣的读者可查看本站专题:《c#窗体操作技巧汇总》、《c#数据结构与算法教程》、《c#常见控件用法教程》、《c#面向对象程序设计入门教程》及《c#程序设计之线程使用技巧总结

希望本文所述对大家c#程序设计有所帮助。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网