کد:
Private Sub Command1_Click()
Dim GoToVal As Integer
Dim Gointo As Integer
GoToVal = Me.Height / 2
For Gointo = 1 To GoToVal
'NEW ADDITION NEXT LINE
DoEvents
Me.Height = Me.Height - 10
Me.Top = (Screen.Height - Me.Height) \ 2
If Me.Height <= 11 Then GoTo horiz
Next Gointo
'This is the width part of the same sequence above
horiz:
Me.Height = 30
GoToVal = Me.Width / 2
For Gointo = 1 To GoToVal
'NEW ADDITION NEXT LINE
DoEvents
Me.Width = Me.Width - 10
Me.Left = (Screen.Width - Me.Width) \ 2
If Me.Width <= 11 Then End
Next Gointo
End
End Sub