Private Sub form_Animation_open(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

For i = 0 To f_w Step loop_step

your_form.Height = i

your_form.Show

Next i

Case Is = 3

For i = 0 To f_w Step loop_step

your_form.Height = i

your_form.Show

DoEvents

Next i

For i = 0 To f_h Step loop_step

your_form.Height = i

your_form.Show

DoEvents

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_Load()

form_Animation_open Me, 1, 3

End Sub

Private Sub Form_Unload(Cancel As Integer)

form_Animation_closer Me, -2

Me.WindowState = 1

End Sub

Public 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 step_loop

your_form.Height = i

your_form.Show

DoEvents

Next i

exit_sub:

End Sub

نوشته شده در تاریخ سه شنبه 17 آذر 1388    | توسط: محمد و مجید َ    |    |
نظرات()