kurze frage für zwischen durch habe einen würfel programiert + counter
mein problem der counter wird immer zu 6 ich vermute " For i = 0 To " ist das problem
mein problem der counter wird immer zu 6 ich vermute " For i = 0 To " ist das problem
Visual Basic-Quellcode
-
- Private Sub Form_Load()
- Dim C As Byte
- C = 1
- End Sub
- Private Sub Würfeln_Knopf_Click()
- Randomize Timer
- w = Int(1 + Rnd * 6)
- For i = 0 To 6
- Shape2.Visible = False
- Shape3.Visible = False
- Shape4.Visible = False
- Shape5.Visible = False
- Shape6.Visible = False
- Shape7.Visible = False
- Shape8.Visible = False
- Label2.Caption = C
- C = C + 1
- Next
- If w = 1 Then
- Shape2.Visible = True
- End If
- If w = 2 Then
- Shape3.Visible = True
- Shape4.Visible = True
- End If
- If w = 3 Then
- Shape2.Visible = True
- Shape3.Visible = True
- Shape4.Visible = True
- End If
- If w = 4 Then
- Shape3.Visible = True
- Shape4.Visible = True
- Shape5.Visible = True
- Shape6.Visible = True
- End If
- If w = 5 Then
- Shape2.Visible = True
- Shape3.Visible = True
- Shape4.Visible = True
- Shape5.Visible = True
- Shape6.Visible = True
- End If
- If w = 6 Then
- Shape3.Visible = True
- Shape4.Visible = True
- Shape5.Visible = True
- Shape6.Visible = True
- Shape7.Visible = True
- Shape8.Visible = True
- End If
- End Sub