VB (Program Modul_2_No.3)

Public Class Form1
Dim a As Integer = 0
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
a = a + 1
If a = 1 Then
PictureBox1.ImageLocation = "F:\1\vb\082121774\moon01.ico"
ElseIf a = 2 Then
PictureBox1.ImageLocation = "F:\1\vb\082121774\moon02.ico"
ElseIf a = 3 Then
PictureBox1.ImageLocation = "F:\1\vb\082121774\moon03.ico"
ElseIf a = 4 Then
PictureBox1.ImageLocation = "F:\1\vb\082121774\moon04.ico"
ElseIf a = 5 Then
PictureBox1.ImageLocation = "F:\1\vb\082121774\moon05.ico"
ElseIf a = 6 Then
PictureBox1.ImageLocation = "F:\1\vb\082121774\moon06.ico"
ElseIf a = 7 Then
PictureBox1.ImageLocation = "F:\1\vb\082121774\moon07.ico"
ElseIf a = 8 Then
PictureBox1.ImageLocation = "F:\1\vb\082121774\moon08.ico"
Else
a = 0
End If
End Sub


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
Timer1.Interval = 50
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
End Sub
End Class

Download...

Category: 0 komentar

Tidak ada komentar:

Posting Komentar