0% found this document useful (0 votes)
29 views

Angka Object Eventargs

The document contains code for a program with 5 labels that change color and location when mouse enters and leaves. There are 5 timers that control the movement and color change of the labels. Each timer moves and changes the color of the labels in a different pattern when its associated label is moused over.

Uploaded by

irvandhi hito h
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Angka Object Eventargs

The document contains code for a program with 5 labels that change color and location when mouse enters and leaves. There are 5 timers that control the movement and color change of the labels. Each timer moves and changes the color of the labels in a different pattern when its associated label is moused over.

Uploaded by

irvandhi hito h
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Public Class Angka

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load

End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles satu.Tick
Label2.Location = New Point(Label2.Location.X + 3, Label2.Location.Y - 3)
Label2.Text += 1
Label2.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label3.Location = New Point(Label3.Location.X + 3, Label3.Location.Y + 3)
Label3.Text += 1
Label3.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label4.Location = New Point(Label4.Location.X - 3, Label4.Location.Y + 3)
Label4.Text += 1
Label4.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label5.Location = New Point(Label5.Location.X - 3, Label5.Location.Y - 3)
Label5.Text += 1
Label5.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
End Sub
Private Sub Label1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Label1.MouseEnter
satu.Start()
End Sub
Private Sub Label1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Label1.MouseLeave
satu.Stop()
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles dua.Tick
Dim a As Double
a = 1.5
Label1.Location = New Point(Label1.Location.X - a, Label1.Location.Y + a)
Label1.Text += 1
Label1.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label3.Location = New Point(Label3.Location.X, Label3.Location.Y + 3)
Label3.Text += 1
Label3.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label4.Location = New Point(Label4.Location.X - 3, Label4.Location.Y + 3)
Label4.Text += 1
Label4.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label5.Location = New Point(Label5.Location.X - 3, Label5.Location.Y)
Label5.Text += 1
Label5.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
End Sub
Private Sub Label2_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Label2.MouseEnter
dua.Start()
End Sub
Private Sub Label2_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Label2.MouseLeave
dua.Stop()
End Sub

Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles tiga.Tick
Dim a As Double
a = 1.5
Label1.Location = New Point(Label1.Location.X - a, Label1.Location.Y - a)
Label1.Text += 1
Label1.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label2.Location = New Point(Label2.Location.X, Label2.Location.Y - 3)
Label2.Text += 1
Label2.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label4.Location = New Point(Label4.Location.X - 3, Label4.Location.Y)
Label4.Text += 1
Label4.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label5.Location = New Point(Label5.Location.X - 3, Label5.Location.Y - 3)
Label5.Text += 1
Label5.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
End Sub
Private Sub Label3_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Label3.MouseEnter
tiga.Start()
End Sub
Private Sub Label3_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Label3.MouseLeave
tiga.Stop()
End Sub
Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles empat.Tick
Dim a As Double
a = 1.5
Label1.Location = New Point(Label1.Location.X + a, Label1.Location.Y - a)
Label1.Text += 1
Label1.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label2.Location = New Point(Label2.Location.X + 3, Label2.Location.Y - 3)
Label2.Text += 1
Label2.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label3.Location = New Point(Label3.Location.X + 3, Label3.Location.Y)
Label3.Text += 1
Label3.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label5.Location = New Point(Label5.Location.X, Label5.Location.Y - 3)
Label5.Text += 1
Label5.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
End Sub
Private Sub Label4_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Label4.MouseEnter
empat.Start()
End Sub
Private Sub Label4_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Label4.MouseLeave
empat.Stop()
End Sub
Private Sub Timer5_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles lima.Tick
Dim a As Double
a = 1.5
Label1.Location = New Point(Label1.Location.X + a, Label1.Location.Y + a)
Label1.Text += 1

Label1.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)


Label2.Location = New Point(Label2.Location.X + 3, Label2.Location.Y)
Label2.Text += 1
Label2.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label3.Location = New Point(Label3.Location.X + 3, Label3.Location.Y + 3)
Label3.Text += 1
Label3.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label4.Location = New Point(Label4.Location.X, Label4.Location.Y + 3)
Label4.Text += 1
Label4.ForeColor = Color.FromArgb(255, Rnd() * 255, Rnd() * 255, Rnd() * 255)
End Sub
Private Sub Label5_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Label5.MouseEnter
lima.Start()
End Sub
Private Sub Label5_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Label5.MouseLeave
lima.Stop()
End Sub
End Class

You might also like