Sharing on how to achieve the pop-up window result in the lower right corner in C# winform

黄舟
Release: 2017-06-18 10:18:32
Original
2471 people have browsed it

This article mainly introduces the method of C# winform to realize the pop-up window result in the lower right corner, and analyzes the relevant skills of C# window operation in the form of examples. Friends in need can refer to the following

The examples of this article describe C # Winform method to realize the pop-up window result in the lower right corner. Share it with everyone for your reference, the details are as follows:


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);
}
Copy after login

The above is the detailed content of Sharing on how to achieve the pop-up window result in the lower right corner in C# winform. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template