VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This will cause the form to shrink smaller and smaller and eventually close, giving your window a b

by Atul Kumar Gupta (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 7th April 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This will cause the form to shrink smaller and smaller and eventually close, giving your window a better closing animation. Speed can be

API Declarations


'Form Shrinking Animation Designed and Created by Atul Kumar Gupta
Dim I As Integer
Dim H As Integer
Dim W As Integer
Dim X As Integer 'Speed rate at which form shrinks

Rate This will cause the form to shrink smaller and smaller and eventually close, giving your window a b



I = 0
X = 50 'Decrease value to increase shrink speed/increase to slow down
H = Form1.Height
W = Form1.Width
Timer1.Enabled = False
Timer1.Interval = 2 'Decrease to speed up the shrink/increase to slow it down
End Sub

Private Sub Command1_Click()
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
I = I + 1
If I = X Then
    Unload Form1
Else
    Form1.Height = Form1.Height - Int(H / X)
    Form1.Width = Form1.Width - Int(W / X)
    Form1.Top = Form1.Top + Int((H / X) / 2)
    Form1.Left = Form1.Left + Int((H / X) / 2)
End If
End Sub

Download this snippet    Add to My Saved Code

This will cause the form to shrink smaller and smaller and eventually close, giving your window a b Comments

No comments have been posted about This will cause the form to shrink smaller and smaller and eventually close, giving your window a b. Why not be the first to post a comment about This will cause the form to shrink smaller and smaller and eventually close, giving your window a b.

Post your comment

Subject:
Message:
0/1000 characters