0% found this document useful (0 votes)
56 views2 pages

Source Code - Slot Machine

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

Source Code - Slot Machine

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

Public Class Form1

Dim m, a, b, c As Integer
Private Sub BtnSpin_Click(sender As Object, e As EventArgs) Handles BtnSpin.Click
Timer1.Enabled = True
End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick


m = m + 10
If m < 1000 Then

a = Int(1 + Rnd() * 3)

b = Int(1 + Rnd() * 3)

c = Int(1 + Rnd() * 3)

Select Case a
Case 1
PictureBox1.Image = Image.FromFile("C:\Users\admin\Documents\vb2019\images\
strawberry.jpg")
Case 2
PictureBox1.Image = Image.FromFile("C:\Users\admin\Documents\vb2019\images\
grape.jpg")
Case 3
PictureBox1.Image = Image.FromFile("C:\Users\admin\Documentsvb2019\images\
apple.jpg")

End Select

Select Case b
Case 1
PictureBox2.Image = Image.FromFile("C:\Users\admin\Documents\vb2019\images\
strawberry.jpg")
Case 2
PictureBox2.Image = Image.FromFile("C:\Users\admin\Documents\vb2019\images\
grape.jpg")
Case 3
PictureBox2.Image = Image.FromFile("C:\Users\admin\Documents\vb2019\images\
apple.jpg")

End Select
Select Case c
Case 1
PictureBox3.Image = Image.FromFile("C:\Users\admin\Documents\vb2019\images\
strawberry.jpg")
Case 2
PictureBox3.Image = Image.FromFile("C:\Users\admin\Documents\vb2019\images\
grape.jpg")
Case 3
PictureBox3.Image = Image.FromFile("C:\Users\admin\Documents\vb2019\images\
apple.jpg")

End Select

Else
Timer1.Enabled = False
m = 0
If a = b Then
LblMsg.Text = "Good Luck! You won $200!"
ElseIf a = c Then

LblMsg.Text = "Good Luck! You won $500!"


ElseIf b = c Then

LblMsg.Text = "Good Luck! You won $1000!"

ElseIf a = b And b = c Then

LblMsg.Text = “Jackpot! You won $1,000,000!"


Else
LblMsg.Text = “No luck, try again”

End If
End If

End Sub
End Class

You might also like