Private Sub Form_Load()
    
    Dim i As Integer
    
    Me.Width = 0
    Me.Height = 0
    Timer1.Interval = 1
    
    
End SubPrivate Sub Timer1_Timer()    If Me.Width >= 3000 Then
        Timer1.Enabled = False
    Else
        Me.Move Me.Left - 50, Me.Top - 50, Me.Width + 100, Me.Height + 100
        DoEvents
    End If
End Sub

解决方案 »

  1.   

    下列代码用API实现,各种效果参数都给了,你可以自己试。(不支持win95)
    Dim mbWindows98orHigher As Boolean
    '
    ' Constants used by AnimateWindow
    '
    'Duration of animation in milliseconds
    Const AW_DURATION_DEFAULT = 200
    'Animate from left to right
    Const AW_HOR_POSITIVE = &H1
    'Animate from right to left
    Const AW_HOR_NEGATIVE = &H2
    'Animate from top to bottom
    Const AW_VER_POSITIVE = &H4
    'Animate from bottom to top
    Const AW_VER_NEGATIVE = &H8
    'Collapse window inward when used with
    '  AW_HIDE or outward otherwise
    Const AW_CENTER = &H10
    'Hides the window
    Const AW_HIDE = &H10000
    'Activates the window
    Const AW_ACTIVATE = &H20000
    'Slide animation. Cannot use with AW_CENTER
    Const AW_SLIDE = &H40000
    'Fade window. Only works with top level windows
    Const AW_BLEND = &H80000Const VER_PLATFORM_WIN32_WINDOWS = 1Private Type OSVERSIONINFO
        dwOSVersionInfoSize As Long
        dwMajorVersion      As Long
        dwMinorVersion      As Long
        dwBuildNumber       As Long
        dwPlatformID        As Long
        szCSDVersion        As String * 128
    End TypePrivate Declare Function AnimateWindow Lib "user32" (ByVal hwnd As Long, ByVal dwTime As Long, ByVal dwFlags As Long) As BooleanPrivate Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As LongPrivate Sub Form_load(Cancel As Integer)If Not mbWindows98orHigher Then Exit Sub
        Call AnimateWindow(Me.hwnd, 1000, _
                    AW_SLIDE Or AW_VER_POSITIVE Or AW_ACTIVATE)Set frmAbout = NothingEnd SubPrivate Function fGetOSVersion()
    Dim os As OSVERSIONINFO
    '
    ' Returns True if Win98 or Win2000
    '
    fGetOSVersion = False
    With os
        .dwOSVersionInfoSize = Len(os)
        Call GetVersionEx(os)    ' Windows 2000
        If .dwMajorVersion > 4 Then fGetOSVersion = True    If .dwMajorVersion = 4 And _
           .dwPlatformID = VER_PLATFORM_WIN32_WINDOWS And _
           .dwMinorVersion > 0 Then
            fGetOSVersion = True
        End If
    End With
    End Function
    Private Sub Form_Unload(Cancel As Integer)If Not mbWindows98orHigher Then Exit Sub
        Call AnimateWindow(Me.hwnd, 1000, _
                    AW_SLIDE Or AW_VER_POSITIVE Or AW_HIDE)Set frmAbout = NothingEnd Sub