Using System.Runtime.InteropServices;
[DllImport ("user32")]
private static extern bool AnimateWindow (INTPTR hwnd, int dwtime, int dwFlags);
The following constants are available, which are declared in accordance with the results of an inappropriate animation
Private Const int aw_hor_positive = 0 x0001;//Displays the window from left to right, which can be applied in the migration Transitions animation and slide animations. Ignore this tag when applying aw_center tags
Private Const int aw_hor_negative = 0 x0002;//A right-to-left display window that can be applied in the migration Transitions animation and slide animations. Ignore this tag when applying aw_center tags
Private Const int aw_ver_positive = 0 x0004;//A top-down display window that can be applied in the migration Transitions animation and slide animations. Ignore this tag when applying aw_center tags
Private Const int aw_ver_negative = 0 x0008;//from the bottom up Display window, which can be applied in the migration Transitions animation and slide animations. The tag is ignored when the aw_center tag is applied
Private Const int Aw_center = 0 x0010;//If the aw_hide tag is applied, the window overlaps inside; otherwise it expands outwards.
Private Const int aw_hide = 0 x10000;//Hidden window
Private Const int aw_active = 0 x20000;//activation window, do not apply this tag after applying the aw_hide tag
Private Const int Aw_slide = 0 x40000;//applies the slide type animation result, the default is the migration transition animation type, when the aw_center tag is applied, the tag is ignored
Private Const int aw_blend = 0 x80000;//fade results applied
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);//setup form appears in the lower-right corner of the screen
AnimateWindow (this. Handle, Aw_slide | aw_active | aw_ver_negative);
}
private void Form1_formclosing (object sender, FormClosingEventArgs e)
{
AnimateWindow (this. Handle, Aw_blend | Aw_hide);
}
Copy Code (EDIT: Lelinpeng Source: Network)
C # WinForm method for implementing pop-up window results in the lower right corner