Friday, 10 October 2014

VB6 SPLASH SCREEN



HOW TO MAKE SPASH SCREEN IN VB6
1)     Design form as shown in the below image:
2)     Choose Marchoso component: 

v It  may not be in vb. So download this component from web = Marchoso.ocx
v save  Marchoso.ocx in the same folder
v Project menu > components (ctrl + T) > Browse  > Marchoso.ocx > open    >  Marchoso Active contol module  > Apply > ok

3)      2 Timer control (Timer 1=marchoso animation ,  Timer 2 = label animation)


Properties window
 Timer 1  (marchoso animation)
Interval  =200
 Timer 2   (word animation)
Interval  =500



4)   Code :

( General = Declration)

Option Explicit
Private StrCap As String
Private Num As Long


Rounded Rectangular Callout: Gif image file Name
 
Private Sub Form_Load()

Marchoso1.FileName = App.Path & "\8.gif"
StrCap = lblCaption.Caption
    lblCaption.Alignment = 0
End Sub


Private Sub Timer1_Timer()

Timer1.Interval = Rnd * 300 + 10
ProgressBar1.Value = ProgressBar1.Value + 2
Label1.Caption = ProgressBar1.Value & "%"
If Label1.Caption = 100 & "%" Then
Unload Me
Form1.Show
End If
End Sub

Private Sub Timer2_Timer()

If lblCaption.Caption <> StrCap Then
     If lblCaption.Alignment = 0 Then
         lblCaption.Caption = Left(StrCap, Len(lblCaption.Caption) + 1)
     End If
   Else
     lblCaption.Caption = ""
      Num = 0
   End If
End Sub
5)     Run the Application