C # WinForm method for implementing pop-up window results in the lower right corner

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.