Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Dim time As Integer = 50
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles SpinButton.Click
- Timer1.Enabled = True
- Randomize()
- ' if button clicked
- ' randomly select item from array
- ' How to code the images flipping through
- ' When button clicked, set timer that counts down to a certain amount of time.
- ' How do you get the image to slowly change/wait for the next image?
- ' After time is up, randomly choose an element from the list?
- Dim picnumselect As String
- Dim PictureNumber As String() = New String() {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"}
- picnumselect = Str((Int(Rnd() * 11) + 1))
- ' Dim z As String = "C:\Users\chongg\Documents\Visual Studio 2015\"
- ' Dim g As String = "Projects\SlotMachine\SlotMachine\Resources\icon" + picnumselect + ".PNG"
- ' g = g.Replace(" ", "")
- ' Label1.Text = z + g
- ' PictureBox.Image = Image.FromFile() chooses an image from the file directory.
- ' PictureBox4.Image = Image.FromFile(z + g)
- 'NOW THE PROBLEM IS THAT THE PICTURES ARE NOT RESIZING CORRECTLY BECAUSE IN THE FILE THEY'RE REALLY BIG
- End Sub
- Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
- End Sub
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- End Sub
- Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
- time = time - 1
- Label1.Text = time
- ' If you have 10 pictures, you'd do time Mod 10 = 0,1,2,3,...9
- If time Mod 5 = 0 Then
- PictureBox2.BackgroundImage = My.Resources.icon3
- ElseIf time Mod 5 = 1 Then
- PictureBox2.BackgroundImage = My.Resources.icon1
- Else
- PictureBox2.BackgroundImage = My.Resources.icon10
- End If
- If time <= 0 Then
- Timer1.Enabled = False
- time = 50
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement