Need help with dice pictures showing on buttons

  • (2 Pages)
  • +
  • 1
  • 2

18 Replies - 4494 Views - Last Post: 27 December 2012 - 06:45 PM Rate Topic: -----

#1 Arctiq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 23-December 12

Need help with dice pictures showing on buttons

Posted 23 December 2012 - 07:24 PM

Hello all, I am new here so I'm not sure if this is the right place. I am currently trying to make my final project for vb class and I've been stumped for at least five days on this code. I'm trying to make a program to emulate the game "farkle". My problem is that when I press the "roll" button on my form, its supposed to show six randomly generated dice on six buttons. My problem is that no matter what I do, it won't show on the dice. Here is my code. I condensed it because I am on my phone and there is no internet at my grandmas house:

Dim dicerand1 As Integer
...
Dim Dicerand6 As Integer

Dim diceRandom As New Random

Dicerand1 = dicerandom.next(1, 7)
...
Dicerand2 = dicerandom.next(1, 7)

'=====Case for the first random dice=====
Select Case diceRand1
	 Case 1
		   BtnShowDice1.backgroundImage = My.Resources.small_dice_1
	  ...
	 Case 6
		   Btnshowdice1.backgroundImage = My.resources.small_dice_6
	  End Select

...
	  '=====case for the sixth random dice=====
	  Select case dicerand6
			Case 1
				 Btnshowdice6.backgroundImage = My.Resources.small_dice_1
			...
			Case 6
				 Btnshowdice6.backgroundImage = my.resources.small_dice_6
			End Select



Is This A Good Question/Topic? 0
  • +

Replies To: Need help with dice pictures showing on buttons

#2 kai_itz me  Icon User is offline

  • D.I.C Head

Reputation: 28
  • View blog
  • Posts: 159
  • Joined: 03-August 12

Re: Need help with dice pictures showing on buttons

Posted 23 December 2012 - 10:04 PM

LET ME CLEAR MY POINTS

as far as i got, you have a button roll..when you press roll you want six randoms number at six different buttons ,,

or

YOU WANT SIX RANDOM NUMBERS ON SIX DIFFREBT BUTTONS ....

This post has been edited by kai_itz me: 23 December 2012 - 10:04 PM

Was This Post Helpful? 0
  • +
  • -

#3 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 300
  • View blog
  • Posts: 1,776
  • Joined: 26-March 09

Re: Need help with dice pictures showing on buttons

Posted 24 December 2012 - 01:30 AM

This looks like VB.Net code, not VB6.

Have you tried debugging this at all?

Put a breakpoint on your Select Case and check what values you have.

Have you tried to read the images from the resource file into a button without any of the other code (i.e.: One single line of code to set the background image, to ensure that code works - basically, is your image format and size compatible with the button background image)?
Was This Post Helpful? 0
  • +
  • -

#4 Arctiq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 23-December 12

Re: Need help with dice pictures showing on buttons

Posted 24 December 2012 - 08:31 AM

View Postmaj3091, on 24 December 2012 - 01:30 AM, said:

This looks like VB.Net code, not VB6.

Have you tried debugging this at all?

Put a breakpoint on your Select Case and check what values you have.

Have you tried to read the images from the resource file into a button without any of the other code (i.e.: One single line of code to set the background image, to ensure that code works - basically, is your image format and size compatible with the button background image)?


Sorry, I didn't know the difference between vb6 and vb.net... All I knew is that it was vb. The weird thing is when I put a breakpoint on the select case, the program doesn't even break so I could test it. It's weird.
Was This Post Helpful? 0
  • +
  • -

#5 Arctiq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 23-December 12

Re: Need help with dice pictures showing on buttons

Posted 24 December 2012 - 11:08 AM

View PostArctiq, on 24 December 2012 - 08:31 AM, said:

View Postmaj3091, on 24 December 2012 - 01:30 AM, said:

This looks like VB.Net code, not VB6.

Have you tried debugging this at all?

Put a breakpoint on your Select Case and check what values you have.

Have you tried to read the images from the resource file into a button without any of the other code (i.e.: One single line of code to set the background image, to ensure that code works - basically, is your image format and size compatible with the button background image)?


Sorry, I didn't know the difference between vb6 and vb.net... All I knew is that it was vb. The weird thing is when I put a breakpoint on the select case, the program doesn't even break so I could test it. It's weird.


I think what the problem is, is that before the button click event, there are like, 7 or so sub procedures for changing the color of the form. I think the problem is that the code for the button click won't load because of all those sub procedures before it. I think what I'll do is move the button click event above all the other code so that it will load above all the other code. If that won't work, then my logic is wrong.
Was This Post Helpful? 0
  • +
  • -

#6 Arctiq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 23-December 12

Re: Need help with dice pictures showing on buttons

Posted 24 December 2012 - 07:46 PM

View Postkai_itz me, on 23 December 2012 - 10:04 PM, said:

LET ME CLEAR MY POINTS

as far as i got, you have a button roll..when you press roll you want six randoms number at six different buttons ,,

or

YOU WANT SIX RANDOM NUMBERS ON SIX DIFFREBT BUTTONS ....



The second one is more likely what I need, but I need the random numbers to activate pictures for that button also.
Was This Post Helpful? 0
  • +
  • -

#7 kai_itz me  Icon User is offline

  • D.I.C Head

Reputation: 28
  • View blog
  • Posts: 159
  • Joined: 03-August 12

Re: Need help with dice pictures showing on buttons

Posted 24 December 2012 - 09:25 PM

i wanna ask, can you use picturebox in your project .... ?
Was This Post Helpful? 0
  • +
  • -

#8 Arctiq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 23-December 12

Re: Need help with dice pictures showing on buttons

Posted 24 December 2012 - 09:34 PM

View Postkai_itz me, on 24 December 2012 - 09:25 PM, said:

i wanna ask, can you use picturebox in your project .... ?


I am using picture boxes for some of my project, I just thought that using buttons look nicer than nothing on the screen. I want to make it so that when the user clicks on the roll button, six random dice pixtures show up and they can "hold" the dice for points and stuff. I'm not going to go too in depth with it.
Was This Post Helpful? 0
  • +
  • -

#9 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2262
  • View blog
  • Posts: 9,464
  • Joined: 29-May 08

Re: Need help with dice pictures showing on buttons

Posted 24 December 2012 - 09:54 PM

Have you had a look at some of the related topics (listed below this thread)?
Was This Post Helpful? 0
  • +
  • -

#10 kai_itz me  Icon User is offline

  • D.I.C Head

Reputation: 28
  • View blog
  • Posts: 159
  • Joined: 03-August 12

Re: Need help with dice pictures showing on buttons

Posted 24 December 2012 - 09:55 PM

okay.. i got u

follow my instructions...

To generate random numbers, we use the Rnd() function. The syntax to generate six.
integers from 1 to 6 is shown below:
Int(1 + Rnd( ) * 6)


these are the steps...

1)create a window form
2)take 7 buttons and name all for e.g
button1 = dice1
button2 = dice2
button3 = dice3
button4 = dice4
button5 = dice5
button6 = dice6
button7 = roll
3)select timer from your tool box.

4)initialise variable
Dim m, n1, n2, n3,n4,n5,n6 As Integer



5)double click on timer and put the code inside


 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
m = m + 10
        If m < 1000 Then
            n1 = Int(1 + Rnd() * 6)
            Button1.Text = n1
            n2 = Int(1 + Rnd() * 6)
            Button2.Text = n2
            n3 = Int(1 + Rnd() * 6)
            Button3.Text = n3
            n4 = Int(1 + Rnd() * 6)
            Button4.Text = n1
            n5 = Int(1 + Rnd() * 6)
            Button5.Text = n2
            n6 = Int(1 + Rnd() * 6)
            Button6.Text = n3

            Timer1.Enabled = False
            m = 0
'you can also use if-else to put a condition .. say
'If n1=n2=n3=n4=n5=n6 Then
            '    MsgBox ("winner !")
              ' end if

end sub



6) in your button7(roll) click event put this code...

  Timer1.Enabled = True



when you press button7(named as roll u got 6 different no. on ur six button every time)

follow this ,after that tell me what modification further u want,, we will discuss

This post has been edited by kai_itz me: 25 December 2012 - 12:17 AM

Was This Post Helpful? 0
  • +
  • -

#11 lucky3  Icon User is offline

  • Friend lucky3 As IHelpable
  • member icon

Reputation: 231
  • View blog
  • Posts: 765
  • Joined: 19-October 11

Re: Need help with dice pictures showing on buttons

Posted 24 December 2012 - 11:14 PM

Getting random numbers with Int(1 + Rnd( ) * 6) is inherited from VB6. In VB.NET we do it:
Dim rng = New Random 'rng -> random number generator

Sub Whatever()
   'use that rng:
   Dim firstRadom As Integer = rng.Next(1,7) 'upper bound is exclusive
   'etc
End Sub


Was This Post Helpful? 0
  • +
  • -

#12 kai_itz me  Icon User is offline

  • D.I.C Head

Reputation: 28
  • View blog
  • Posts: 159
  • Joined: 03-August 12

Re: Need help with dice pictures showing on buttons

Posted 24 December 2012 - 11:25 PM

THE PREVIOUS CODE JUST PRINT 1 TO 6 NUMBERS OVER THE 6 BUTTONS.

here is the complete solution.

NOW I WILL TELL U HOW TO PUT BACKGROUND IMAGE ON YOUR BUTTONS...
FOR THIS U NEED 6 IMAGES.. I HAVE NAMED THEM AS D1 TO D6.

follow my instructions...

To generate random numbers, we use the Rnd() function.
The syntax to generate six integers from 1 to 6 is shown below:
Int(1 + Rnd( ) * 6)
1)create a window form
2)take 7 buttons and name all for e.g
button1 = dice1
button2 = dice2
button3 = dice3
button4 = dice4
button5 = dice5
button6 = dice6
button7 = roll
3)select timer from your tool box.

4)initialise variable

dim n1,n2,n3,n4,n5,n6 as integer



5) double click on timer and put the code inside

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

        m = m + 10
        If m < 1000 Then
            n1 = Int(1 + Rnd() * 6)

' IT WILL TELL U WHAT NUMBER U WILL GOT ON A PARTICULAR BUTTON
             '  Button1.Text = n1
            n2 = Int(1 + Rnd() * 6)
            '  Button2.Text = n2
            n3 = Int(1 + Rnd() * 6)
            ' Button3.Text = n3
            n4 = Int(1 + Rnd() * 6)
            '  Button4.Text = n1
            n5 = Int(1 + Rnd() * 6)
            ' Button5.Text = n2
            n6 = Int(1 + Rnd() * 6)
            ' Button6.Text = n3

            Select Case n1
                Case 1
                    Me.dice1.BackgroundImage = Image.FromFile("E:\ABHISHEK STUFF\d1.jpg")
                Case 2
                    Me.dice1.BackgroundImage = Image.FromFile("E:\ABHISHEK STUFF\d2.jpg")
                Case 3
                    Me.dice1.BackgroundImage = Image.FromFile("E:\ABHISHEK STUFF\d3.jpg")
                Case 4
                    Me.dice1.BackgroundImage = Image.FromFile("E:\ABHISHEK STUFF\d4.jpg")
                Case 5
                    Me.dice1.BackgroundImage = Image.FromFile("E:\ABHISHEK STUFF\d5.jpg")
                Case 6
                    Me.dice1.BackgroundImage = Image.FromFile("E:\ABHISHEK STUFF\d6.jpg")


            End Select
            Select Case n2
                Case 1
                    Me.dice2.BackgroundImage = Image.FromFile("E:\image\d1.jpg")
                Case 2
                    Me.dice2.BackgroundImage = Image.FromFile("E:\image\d2.jpg")
                Case 3
                    Me.dice2.BackgroundImage = Image.FromFile("E:\image\d3.jpg")
                Case 4
                    Me.dice2.BackgroundImage = Image.FromFile("E:\image\d4.jpg")
                Case 5
                    Me.dice2.BackgroundImage = Image.FromFile("E:\image\d5.jpg")
                Case 6
                    Me.dice2.BackgroundImage = Image.FromFile("E:\image\d6.jpg")

            End Select
            Select Case n3
                Case 1
                    Me.dice3.BackgroundImage = Image.FromFile("E:\image\d1.jpg")
                Case 2
                    Me.dice3.BackgroundImage = Image.FromFile("E:\image\d2.jpg")
                Case 3
                    Me.dice3.BackgroundImage = Image.FromFile("E:\image\d3.jpg")
                Case 4
                    Me.dice3.BackgroundImage = Image.FromFile("E:\image\d4.jpg")
                Case 5
                    Me.dice3.BackgroundImage = Image.FromFile("E:\image\d5.jpg")
                Case 6
                    Me.dice3.BackgroundImage = Image.FromFile("E:\image\d6.jpg")


            End Select
            Select Case n4
                Case 1
                    Me.dice4.BackgroundImage = Image.FromFile("E:\image\d1.jpg")
                Case 2
                    Me.dice4.BackgroundImage = Image.FromFile("E:\image\d2.jpg")
                Case 3
                    Me.dice4.BackgroundImage = Image.FromFile("E:\image\d3.jpg")
                Case 4
                    Me.dice4.BackgroundImage = Image.FromFile("E:\image\d4.jpg")
                Case 5
                    Me.dice4.BackgroundImage = Image.FromFile("E:\image\d5.jpg")
                Case 6
                    Me.dice4.BackgroundImage = Image.FromFile("E:\image\d6.jpg")


            End Select
            Select Case n5
                Case 1
                    Me.dice5.BackgroundImage = Image.FromFile("E:\image\d1.jpg")
                Case 2
                    Me.dice5.BackgroundImage = Image.FromFile("E:\image\d2.jpg")
                Case 3
                    Me.dice5.BackgroundImage = Image.FromFile("E:\image\d3.jpg")
                Case 4
                    Me.dice5.BackgroundImage = Image.FromFile("E:\image\d4.jpg")
                Case 5
                    Me.dice5.BackgroundImage = Image.FromFile("E:\image\d5.jpg")
                Case 6
                    Me.dice5.BackgroundImage = Image.FromFile("E:\image\d6.jpg")


            End Select
            Select Case n6
                Case 1
                    Me.dice6.BackgroundImage = Image.FromFile("E:\image\d1.jpg")
                Case 2
                    Me.dice6.BackgroundImage = Image.FromFile("E:\image\d2.jpg")
                Case 3
                    Me.dice6.BackgroundImage = Image.FromFile("E:\image\d3.jpg")
                Case 4
                    Me.dice6.BackgroundImage = Image.FromFile("E:\image\d4.jpg")
                Case 5
                    Me.dice6.BackgroundImage = Image.FromFile("E:\image\d5.jpg")
                Case 6
                    Me.dice6.BackgroundImage = Image.FromFile("E:\image\d6.jpg")

            End Select
            Timer1.Enabled = False
            m = 0

        End If

    End Sub



6)in your button7(roll) click event put this code...
Timer1.Enabled = True

This post has been edited by kai_itz me: 24 December 2012 - 11:27 PM

Was This Post Helpful? 1
  • +
  • -

#13 Arctiq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 23-December 12

Re: Need help with dice pictures showing on buttons

Posted 26 December 2012 - 03:05 PM

View Postkai_itz me, on 24 December 2012 - 11:25 PM, said:

THE PREVIOUS CODE JUST PRINT 1 TO 6 NUMBERS OVER THE 6 BUTTONS.

here is the complete solution.

NOW I WILL TELL U HOW TO PUT BACKGROUND IMAGE ON YOUR BUTTONS...
FOR THIS U NEED 6 IMAGES.. I HAVE NAMED THEM AS D1 TO D6.

follow my instructions...

To generate random numbers, we use the Rnd() function.
The syntax to generate six integers from 1 to 6 is shown below:
Int(1 + Rnd( ) * 6)
1)create a window form
2)take 7 buttons and name all for e.g
button1 = dice1
button2 = dice2
button3 = dice3
button4 = dice4
button5 = dice5
button6 = dice6
button7 = roll
3)select timer from your tool box.

4)initialise variable

dim n1,n2,n3,n4,n5,n6 as integer



5) double click on timer and put the code inside

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

        m = m + 10
        If m < 1000 Then
            n1 = Int(1 + Rnd() * 6)

' IT WILL TELL U WHAT NUMBER U WILL GOT ON A PARTICULAR BUTTON
             '  Button1.Text = n1
            n2 = Int(1 + Rnd() * 6)
            '  Button2.Text = n2
            n3 = Int(1 + Rnd() * 6)
            ' Button3.Text = n3
            n4 = Int(1 + Rnd() * 6)
            '  Button4.Text = n1
            n5 = Int(1 + Rnd() * 6)
            ' Button5.Text = n2
            n6 = Int(1 + Rnd() * 6)
            ' Button6.Text = n3

            Select Case n1
                Case 1
                    Me.dice1.BackgroundImage = Image.FromFile("E:\ABHISHEK STUFF\d1.jpg")
                Case 2
                    Me.dice1.BackgroundImage = Image.FromFile("E:\ABHISHEK STUFF\d2.jpg")
                Case 3
                    Me.dice1.BackgroundImage = Image.FromFile("E:\ABHISHEK STUFF\d3.jpg")
                Case 4
                    Me.dice1.BackgroundImage = Image.FromFile("E:\ABHISHEK STUFF\d4.jpg")
                Case 5
                    Me.dice1.BackgroundImage = Image.FromFile("E:\ABHISHEK STUFF\d5.jpg")
                Case 6
                    Me.dice1.BackgroundImage = Image.FromFile("E:\ABHISHEK STUFF\d6.jpg")


            End Select
            Select Case n2
                Case 1
                    Me.dice2.BackgroundImage = Image.FromFile("E:\image\d1.jpg")
                Case 2
                    Me.dice2.BackgroundImage = Image.FromFile("E:\image\d2.jpg")
                Case 3
                    Me.dice2.BackgroundImage = Image.FromFile("E:\image\d3.jpg")
                Case 4
                    Me.dice2.BackgroundImage = Image.FromFile("E:\image\d4.jpg")
                Case 5
                    Me.dice2.BackgroundImage = Image.FromFile("E:\image\d5.jpg")
                Case 6
                    Me.dice2.BackgroundImage = Image.FromFile("E:\image\d6.jpg")

            End Select
            Select Case n3
                Case 1
                    Me.dice3.BackgroundImage = Image.FromFile("E:\image\d1.jpg")
                Case 2
                    Me.dice3.BackgroundImage = Image.FromFile("E:\image\d2.jpg")
                Case 3
                    Me.dice3.BackgroundImage = Image.FromFile("E:\image\d3.jpg")
                Case 4
                    Me.dice3.BackgroundImage = Image.FromFile("E:\image\d4.jpg")
                Case 5
                    Me.dice3.BackgroundImage = Image.FromFile("E:\image\d5.jpg")
                Case 6
                    Me.dice3.BackgroundImage = Image.FromFile("E:\image\d6.jpg")


            End Select
            Select Case n4
                Case 1
                    Me.dice4.BackgroundImage = Image.FromFile("E:\image\d1.jpg")
                Case 2
                    Me.dice4.BackgroundImage = Image.FromFile("E:\image\d2.jpg")
                Case 3
                    Me.dice4.BackgroundImage = Image.FromFile("E:\image\d3.jpg")
                Case 4
                    Me.dice4.BackgroundImage = Image.FromFile("E:\image\d4.jpg")
                Case 5
                    Me.dice4.BackgroundImage = Image.FromFile("E:\image\d5.jpg")
                Case 6
                    Me.dice4.BackgroundImage = Image.FromFile("E:\image\d6.jpg")


            End Select
            Select Case n5
                Case 1
                    Me.dice5.BackgroundImage = Image.FromFile("E:\image\d1.jpg")
                Case 2
                    Me.dice5.BackgroundImage = Image.FromFile("E:\image\d2.jpg")
                Case 3
                    Me.dice5.BackgroundImage = Image.FromFile("E:\image\d3.jpg")
                Case 4
                    Me.dice5.BackgroundImage = Image.FromFile("E:\image\d4.jpg")
                Case 5
                    Me.dice5.BackgroundImage = Image.FromFile("E:\image\d5.jpg")
                Case 6
                    Me.dice5.BackgroundImage = Image.FromFile("E:\image\d6.jpg")


            End Select
            Select Case n6
                Case 1
                    Me.dice6.BackgroundImage = Image.FromFile("E:\image\d1.jpg")
                Case 2
                    Me.dice6.BackgroundImage = Image.FromFile("E:\image\d2.jpg")
                Case 3
                    Me.dice6.BackgroundImage = Image.FromFile("E:\image\d3.jpg")
                Case 4
                    Me.dice6.BackgroundImage = Image.FromFile("E:\image\d4.jpg")
                Case 5
                    Me.dice6.BackgroundImage = Image.FromFile("E:\image\d5.jpg")
                Case 6
                    Me.dice6.BackgroundImage = Image.FromFile("E:\image\d6.jpg")

            End Select
            Timer1.Enabled = False
            m = 0

        End If

    End Sub



6)in your button7(roll) click event put this code...
Timer1.Enabled = True



I did exactly what you said to do, but it still won't show?? It won't work even with the My.Resources."ImageNameHere" ...I don't know what I'm doing wrong...

Private Sub btnRoll_Click(sender As Object, e As EventArgs)

        
        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


            'Initializes six random numbers 
            n1 = Int(1 + Rnd() * 6)
            n2 = Int(1 + Rnd() * 6)
            n3 = Int(1 + Rnd() * 6)
            n4 = Int(1 + Rnd() * 6)
            n5 = Int(1 + Rnd() * 6)
            n6 = Int(1 + Rnd() * 6)



            'Initiates the six dice buttons to one of the six randomly generated dice pictures
            Select Case n1
                Case 1
                    Me.btnShowDice1.BackgroundImage = My.Resources.small_dice_1
                Case 2
                    Me.btnShowDice1.BackgroundImage = My.Resources.small_dice_2
                Case 3
                    Me.btnShowDice1.BackgroundImage = My.Resources.small_dice_3
                Case 4
                    Me.btnShowDice1.BackgroundImage = My.Resources.small_dice_4
                Case 5
                    Me.btnShowDice1.BackgroundImage = My.Resources.small_dice_5
                Case 6
                    Me.btnShowDice1.BackgroundImage = My.Resources.small_dice_6

            End Select


            Select Case n2
                Case 1
                    Me.btnShowDice2.BackgroundImage = My.Resources.small_dice_1
                Case 2
                    Me.btnShowDice2.BackgroundImage = My.Resources.small_dice_2
                Case 3
                    Me.btnShowDice2.BackgroundImage = My.Resources.small_dice_3
                Case 4
                    Me.btnShowDice2.BackgroundImage = My.Resources.small_dice_4
                Case 5
                    Me.btnShowDice2.BackgroundImage = My.Resources.small_dice_5
                Case 6
                    Me.btnShowDice2.BackgroundImage = My.Resources.small_dice_6

            End Select


            Select Case n3
                Case 1
                    Me.btnShowDice3.BackgroundImage = My.Resources.small_dice_1
                Case 2
                    Me.btnShowDice3.BackgroundImage = My.Resources.small_dice_2
                Case 3
                    Me.btnShowDice3.BackgroundImage = My.Resources.small_dice_3
                Case 4
                    Me.btnShowDice3.BackgroundImage = My.Resources.small_dice_4
                Case 5
                    Me.btnShowDice3.BackgroundImage = My.Resources.small_dice_5
                Case 6
                    Me.btnShowDice3.BackgroundImage = My.Resources.small_dice_6

            End Select



            Select Case n4
                Case 1
                    Me.btnShowDice4.BackgroundImage = My.Resources.small_dice_1
                Case 2
                    Me.btnShowDice4.BackgroundImage = My.Resources.small_dice_2
                Case 3
                    Me.btnShowDice4.BackgroundImage = My.Resources.small_dice_3
                Case 4
                    Me.btnShowDice4.BackgroundImage = My.Resources.small_dice_4
                Case 5
                    Me.btnShowDice4.BackgroundImage = My.Resources.small_dice_5
                Case 6
                    Me.btnShowDice4.BackgroundImage = My.Resources.small_dice_6

            End Select


            Select Case n5
                Case 1
                    Me.btnShowDice5.BackgroundImage = My.Resources.small_dice_1
                Case 2
                    Me.btnShowDice5.BackgroundImage = My.Resources.small_dice_2
                Case 3
                    Me.btnShowDice5.BackgroundImage = My.Resources.small_dice_3
                Case 4
                    Me.btnShowDice5.BackgroundImage = My.Resources.small_dice_4
                Case 5
                    Me.btnShowDice5.BackgroundImage = My.Resources.small_dice_5
                Case 6
                    Me.btnShowDice5.BackgroundImage = My.Resources.small_dice_6

            End Select



            Select Case n6
                Case 1
                    Me.btnShowDice6.BackgroundImage = My.Resources.small_dice_1
                Case 2
                    Me.btnShowDice6.BackgroundImage = My.Resources.small_dice_2
                Case 3
                    Me.btnShowDice6.BackgroundImage = My.Resources.small_dice_3
                Case 4
                    Me.btnShowDice6.BackgroundImage = My.Resources.small_dice_4
                Case 5
                    Me.btnShowDice6.BackgroundImage = My.Resources.small_dice_5
                Case 6
                    Me.btnShowDice6.BackgroundImage = My.Resources.small_dice_6

            End Select

            Timer1.Enabled = False
            m = 0
        End If

    End Sub


Was This Post Helpful? 0
  • +
  • -

#14 lucky3  Icon User is offline

  • Friend lucky3 As IHelpable
  • member icon

Reputation: 231
  • View blog
  • Posts: 765
  • Joined: 19-October 11

Re: Need help with dice pictures showing on buttons

Posted 26 December 2012 - 03:09 PM

Your btnRoll_Click is missing Handles btnRoll.Click at the end of the 1st line.
Was This Post Helpful? 1
  • +
  • -

#15 Arctiq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 23-December 12

Re: Need help with dice pictures showing on buttons

Posted 26 December 2012 - 03:26 PM

View Postlucky3, on 26 December 2012 - 03:09 PM, said:

Your btnRoll_Click is missing Handles btnRoll.Click at the end of the 1st line.


Thank you SOOOO MUCH! It works now!
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2