(go) WinForm Form fade effect

Source: Internet
Author: User

Original address: http://blog.csdn.net/a237428367/article/details/5933565

Using System.runtime.interopservices;public class Win32 {public Const Int32 aw_hor_positive = 0x0000000    1;    Open window from left to right public const Int32 aw_hor_negative = 0x00000002;    Open window from right to left public const Int32 aw_ver_positive = 0x00000004;    Open window from top to bottom public const Int32 aw_ver_negative = 0x00000008;            Open window from bottom to top Public const Int32 aw_center = 0x00000010;        Public Const Int32 Aw_hide = 0x00010000;    If you want to use this function when the form is unloaded, add this constant public const Int32 aw_activate = 0x00020000;            After the form is opened by this function, the focus is lost by default unless the public const INT32 Aw_slide = 0x00040000 is added to this constant;       Public Const Int32 Aw_blend = 0x00080000;             Fade effect [DllImport ("user32.dll", CharSet = CharSet.Auto)] public static extern bool AnimateWindow ( INTPTR hwnd,//Handle to Window int dwtime,//duration of animation int Dwflag        S//animation type); }/* Fade inform */private void Form_Load (object sender, EventArgs e) {Win32.animatewindow (this. Handle, win32.aw_blend);} /* Fade out form */private void Form_formclosing (object sender, FormClosingEventArgs e) {Win32.animatewindow (this. Handle, Win32.aw_slide | Win32.aw_hide | Win32.aw_blend);}

  

(go) WinForm Form fade effect

Related Article

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.