C#. NET using AnimateWindow to make a form that fades out special effects

Source: Internet
Author: User

use AnimateWindow to create a form namespace for the fade effect:usingSystem.Runtime.InteropServices; API functions: [DllImport ("User32")]Private Static extern BOOLAnimateWindow (IntPtr whnd,intDwtime,intdwflag);//the values of the Dwflag are as follows Public ConstInt32 aw_hor_positive =0x00000001; //show from left to right Public ConstInt32 aw_hor_negative =0x00000002; //display from right to left Public ConstInt32 aw_ver_positive =0x00000004; //show from top to bottom Public ConstInt32 aw_ver_negative =0x00000008; //show from bottom to top Public ConstInt32 Aw_center =0x00000010; //If the Aw_hide flag is used, the window is overlapped inward, that is , the window is shrunk, otherwise the window is expanded outward, that is, the window is expanded Public ConstInt32 aw_hide =0x00010000; //Hide window, default display window Public ConstInt32 aw_activate =0x00020000; //activates the window. This flag cannot be used after using the AW_HIDE flag Public ConstInt32 aw_slide =0x00040000; //use the sliding type. The default is the scrolling animation type. This flag is ignored when using the Aw_center flag Public ConstInt32 Aw_blend =0x00080000; //transparency from high to low//add code in Form_Load to implement the fade-in formAnimateWindow ( This. Handle, the, Aw_blend |aw_activate);//Multiple Dwflag between | Separated//add code in form_formclosing to fade out a formAnimateWindow ( This. Handle, the, Aw_hor_negative |aw_hide);//you must have aw_hide to see the fade out of the form

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.