gravatar

Bermain Animasi Dengan VB


Dim FrameCount As Long
Private Sub Command1_Click()
  Timer1.Enabled = False
  If LoadGif(Text1, Image1) Then
     FrameCount = 0
     Timer1.Interval = CLng(Image1(0).Tag)
     Timer1.Enabled = True
  End If
End Sub



Private Sub Command2_Click()
   Timer1.Enabled = False
End Sub
Private Sub Command3_Click()
   Timer1.Enabled = True
End Sub
Private Sub Form_Load()
  Text1.Text = App.Path & IIf(Right(App.Path, 1) = "\", "", "\") & "clip.gif"
  Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
    If FrameCount < TotalFrames Then
        Image1(FrameCount).Visible = False
        FrameCount = FrameCount + 1
        Image1(FrameCount).Visible = True
        Timer1.Interval = CLng(Image1(FrameCount).Tag)
    Else
        FrameCount = 0
        For i = 1 To Image1.Count - 1
            Image1(i).Visible = False
        Next i
        Image1(FrameCount).Visible = True
        Timer1.Interval = CLng(Image1(FrameCount).Tag)
    End If
End Sub



free counters

Halaman

Diberdayakan oleh Blogger.