كد هاي زير را در قسمت General فرمتون كپي كنيد:
کد:
Private Sub Form_Animation_Opener(your_form As Form, ByVal loop_step As Integer, ByVal how_open As Integer)
Dim f_h, f_w, i, j
f_w = your_form.Width
f_h = your_form.Height
Select Case how_open
Case Is = 1
For i = 0 To f_h Step loop_step
your_form.Height = i
your_form.Show
Next i
Case Is = 2
For i = 0 To f_w Step loop_step
your_form.Width = i
your_form.Show
Next i
Case Is = 3
your_form.Height = 0
For i = 0 To f_w Step loop_step
your_form.Width = i
your_form.Show
Next i
For i = 0 To f_h Step loop_step
your_form.Height = i
your_form.Show
Next i
Case Is = 4
For i = 0 To f_w Step loop_step
your_form.Height = j
your_form.Width = i
your_form.Show
If j < f_h Then j = j + loop_step
Next i
End Select
End Sub
Private Sub form_Animation_Closer(your_form As Form, loop_step As Integer)
On Error GoTo Exit_sub
Dim f_h, f_w, i, j
f_w = your_form.Width
f_h = your_form.Height
For i = f_h To 0 Step loop_step
your_form.Height = i
your_form.Show
DoEvents
Next i
For i = f_w To 0 Step loop_step
your_form.Width = i
your_form.Show
DoEvents
Next i
Exit_sub:
End Sub
Private Sub Form_Load()
Form_Animation_Opener Me, 2, 3
End Sub
Private Sub Form_Unload(Cancel As Integer)
form_Animation_Closer Form1, -2
Me.WindowState = 1
End Sub