Use the following constants and function in a module
Public Const AW_HOR_POSITIVE = &O1 ‘ Animate the window from
‘left to right. This flag can be used with roll or slide
‘animation It is ignored when used with the AW_CENTER flag.
Public Const AW_HOR_NEGATIVE = &H2 ‘ Animate the window from
‘right to left. This flag can be used with roll or slide
‘animation. It is ignored when used with the AW_CENTER flag.
Public Const AW_VER_POSITIVE = &H4 ‘ Animate the window from
‘top to bottom. This flag can be used with roll or slide
‘animation. It is ignored when used with the AW_CENTER flag.
Public Const AW_VER_NEGATIVE = &H8 ‘ Animate the window from
‘bottom to top. This flag can be used with roll or slide
‘animation. It is ignored when used with the AW_CENTER flag.
Public Const AW_CENTER = &H10 ‘ Makes the window appear to
‘collapse inward if the AW_HIDE flag is used or expand outward
‘if the AW_HIDE flag is not used.
Public Const AW_HIDE = &H10000 ‘ Hides the window. By default,
‘the window is shown.
Public Const AW_ACTIVATE = &H20000 ‘ Activates the window. Do
‘not use this flag with AW_HIDE.
Public Const AW_SLIDE = &H40000 ‘ Uses slide animation. By
‘default, roll animation is used. This flag is ignored when used
‘with the AW_CENTER flag.
Public Const AW_BLEND = &H80000 ‘ Uses a fade effect. This flag
‘can be used only if hwnd is a top-level window.
Public Declare Function AnimateWindow Lib “user32″ ( _
ByVal hWnd As Long, ByVal dwTime As Long, _
ByVal dwFlags As Long) As Boolean
Now in your forms unload event try this.
Call AnimateWindow(Me.hWnd, 600, AW_CENTER Or AW_HIDE)
You can also use these methods in the forms load event.
And there you go. Quick, simple and effective. This gives your forms a great unload effect.










































