Attribute VB_Name = "Module1"

Public Sub AnimClose(frm As Form)
On Error Resume Next
Dim GotoVal As Integer
Dim Gointo As Integer

    GotoVal = frm.Height / 2
    For Gointo = 1 To GotoVal
        DoEvents
        frm.Height = frm.Height - 300
        frm.Top = (Screen.Height - frm.Height) \ 2
        If frm.Height <= 500 Then Exit For
    Next Gointo
    
    frm.Height = 30
    GotoVal = frm.Width / 2
        For Gointo = 1 To GotoVal
        DoEvents
        frm.Width = frm.Width - 300
        frm.Left = (Screen.Width - frm.Width) \ 2
        If frm.Width <= 500 Then Exit For
    Next Gointo
End Sub
