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.