hi guys,
I would be grateful, chears friends.
i have a loop in here what suppose to add a rondomly choosen number and show it on the label .text increase every time by the the same number when appear. It does not do it correctly. that is the code:
Private Sub licz()
Dim pbs() As PictureBox = {PictureBox1, PictureBox2, PictureBox3, PictureBox4, PictureBox5}
Dim las() As Label = {Label1, Label2, Label3, Label4, Label5, Label6, Label7, Label8, Label9, Label10, Label11, Label12, Label13, Label14, Label15}
Dim r As New Random
Dim rr As Integer
For Each p In pbs
rr = r.Next(1, 7)
If p.BorderStyle <> BorderStyle.Fixed3D Then
p.Image = Image.FromFile(Application.StartupPath + "\Dice" + rr.ToString + ".png")
las(rr - 1).Text = rr
las(rr - 1).Text = CStr(CInt(las(rr - 1).Text + (rr)))' that should work but it can not convert it to ''string''
End If
Next
End Sub
Private Sub licz()
Dim pbs() As PictureBox = {PictureBox1, PictureBox2, PictureBox3, PictureBox4, PictureBox5}
Dim las() As Label = {Label1, Label2, Label3, Label4, Label5, Label6, Label7, Label8, Label9, Label10, Label11, Label12, Label13, Label14, Label15}
Dim r As New Random
Dim rr As Integer
For Each p In pbs
rr = r.Next(1, 7)
If p.BorderStyle <> BorderStyle.Fixed3D Then
p.Image = Image.FromFile(Application.StartupPath + "\Dice" + rr.ToString + ".png")
las(rr - 1).Text = rr
las(rr - 1).Text = CStr(CInt(las(rr - 1).Text + (rr)))' that should work but it can not convert it to ''string''
End If
Next
End Sub
I would be grateful, chears friends.