View Single Post
Old Apr 1st, 2005, 1:54 PM   #1
fox123
Newbie
 
Join Date: Mar 2005
Posts: 25
Rep Power: 0 fox123 is on a distinguished road
Lightbulb Visual Basic 6.0 Form Effects

Hi,
Does anyone know some code which enables a form to "Fade in and Fade Out"
Also Does anyone know how to make a form "Shrink" Below is some code to make a form Grow

You must first create a module (See Below)
Public Sub CentreForm(F As Form)
  F.Move (Screen.Width - F.Width) \ 2, (Screen.Height - F.Height) \ 2
End Sub

Now insert this into the form

 Private Sub Form_Load()
    Me.Width = 0 'Starting Size Can Be Changed To What You Want
    Me.Height = 0
    Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2
    Timer1.Enabled = True
    End Sub 

    Private Sub Timer1_Timer()  
    Me.Height = Me.Height + 50
         Me.Width = Me.Width + 72

    If Me.Width > 6195 Then  'Can be change accordingly
         Timer1.Enabled = False
    End If
    CentreForm Me ' Relates to module
    End Sub

Timers must be set to an interval of 1

Can the above code be change to make it shrink?
Any Ideas about the fading?
Thanks

Last edited by fox123; Apr 1st, 2005 at 2:06 PM.
fox123 is offline   Reply With Quote