You are on page 1of 3

Public Class Form2

Public s As Integer
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
s = 1200
Form1.Show()
Form1.Timer1.Start()
Me.Hide()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
s = 800
Form1.Show()
Form1.Timer1.Start()
Me.Hide()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
s = 400
Form1.Show()
Form1.Timer1.Start()
Me.Hide()
End Sub
End Class

Public Class Form1


Dim p As Integer = 1
Dim hasil As Integer = 0
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
PictureBox1.Location = New Point((Me.Width - 100) * Rnd(),
(Me.Height - 100) * Rnd())
Timer2.Start()
End Sub
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer3.Tick
PictureBox2.Location = New Point((Me.Width - 100) * Rnd(),
(Me.Height - 100) * Rnd())
PictureBox3.Location = New Point((Me.Width - 100) * Rnd(),
(Me.Height - 100) * Rnd())
PictureBox4.Location = New Point((Me.Width - 100) * Rnd(),
(Me.Height - 100) * Rnd())
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer2.Tick
Timer4.Stop()
Timer5.Stop()
My.Computer.Audio.Play(My.Resources.suara_nyamuk1,
AudioPlayMode.Background)
End Sub
Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer4.Tick
My.Computer.Audio.Play(My.Resources._select,
AudioPlayMode.Background)
End Sub
Private Sub Timer5_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer5.Tick
My.Computer.Audio.Play(My.Resources.Shc, AudioPlayMode.Background)
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles PictureBox1.Click
Label3.Text = 1 + hasil.ToString
hasil = hasil + p
Timer2.Stop()
Timer4.Start()
End Sub
Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles PictureBox2.Click
Label3.Text = hasil.ToString
hasil = hasil - p
Timer2.Stop()
Timer5.Start()
End Sub
Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles PictureBox3.Click
Label3.Text = hasil.ToString
hasil = hasil - p
Timer2.Stop()
Timer5.Start()
End Sub

Private Sub PictureBox4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles PictureBox4.Click
Label3.Text = hasil.ToString
hasil = hasil - p
Timer2.Stop()
Timer5.Start()
End Sub
Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As
System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
MsgBox("selesai BY KELOMPOK 4")
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
Form2.Show()
Me.Hide()
Timer1.Stop()
Label3.Text = hasil.ToString
hasil = 0
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Timer1.Interval = Form2.s
End Sub
End Class