"C #" form animation effect

Source: Internet
Author: User

By calling the API, you can animate the C # form, calling the User32.dll number of rows AnimateWindow

1. Functions affirm

[System.Runtime.InteropServices.DllImport ("user32")]

private static extern bool AnimateWindow (INTPTR hwnd, int dwtime, int dwFlags);

Handle to controls on the HWND interface

Dwtime duration of the form effect execution (in milliseconds)

DwFlags the value of a form effect

2, dwflags to pass the parameter is some type of int constant

const int aw_hor_positive = 0x0001; Front _ Horizontal Direction

const int aw_hor_negative = 0x0002;//Negative _ Horizontal direction

const int aw_ver_positive = 0x0004; Front _ Vertical Direction

const int aw_ver_negative = 0x0008;//Negative _ Vertical direction

const int Aw_center = 0x0010;//is expanded by the middle or is narrowed by the surrounding center

const int aw_hide = 0x10000; Hide Objects

const int aw_activate = 0x20000;//Display Object

const int aw_slide = 0x40000;//Pull Screen Slide effect

const int aw_blend = 0x80000;//fade Gradient effect

3, call, as long as the form of the Load event to add code, such as:

AnimateWindow (this. Handle, aw_blend);//fade-out gradient effect can be achieved

"C #" form animation effect

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.