Realizing the dynamic effect of the form in VB

Source: Internet
Author: User
Tags constant

In VB programming, the appearance and shutdown of application forms are generally static, however, we use the following API function AnimateWindow can easily implement the dynamic effect of the form.

The Declaration of the API function AnimateWindow is as follows:

Private Declare Function animatewindow Lib "user32" (ByVal hwnd as Long, ByVal dwtime as Long, ByVal dwflags as Long) as L Ong

Where the HWND is valid only for form; Dwtime is the duration of the animation, the default is 200;dwflags animation, you can take &&h1, &&H2, &&h4, &&h5, &&h6, &&h8, &&h9 and &&h10 a total of 8 values, representing the left, right, upper and lower, top to bottom right, upper right to lower left, lower left to upper right, and middle to four weeks.

Aw_hide = &&h10000 If you want to use this function when you uninstall a form, you must add this constant

Aw_activate = &&h20000 When a form is opened by this function, the focus is lost by default unless you add this constant

Aw_slide = &&h40000

Aw_blend = &&h80000 fade effect (applicable to WIN2000)

Next, we give an example to familiarize friends with the use of AnimateWindow functions.

Example: gradually display form from upper left to lower right corner

Private Sub Form_Load ()

AnimateWindow hwnd, 3000, &&H5

Form1.refresh

End Sub

The above program runs through the pwin98,vb6.0 Chinese Enterprise Edition.

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.