ciao a tutti!
in vb6 io ho questo codice:
codice:
Private Sub Command1_Click()
Dim contA, contB, contC, contAS As Integer
contA = 0
contB = 0
contC = 0
contAS = 0
Dim vettore(10) As String
vettore(0) = "1"
vettore(1) = "2"
vettore(2) = "1"
vettore(3) = "3"
vettore(4) = "*"
vettore(5) = "1"
vettore(6) = "2"
vettore(7) = "3"
vettore(8) = "1"
vettore(9) = "2"
Randomize
Text1(0).Text = vettore(Int(Rnd * 10))
Text1(1).Text = vettore(Int(Rnd * 10))
Text1(2).Text = vettore(Int(Rnd * 10))
For i = 0 To 2
Select Case Text1(i).Text
Case "1"
contA = contA + 1
Case "2"
contB = contB + 1
Case "3"
contC = contC + 1
Case "*"
contAS = contAS + 1
End Select
Next i
If contA = 2 Then
MsgBox "ci sono due 1"
ElseIf contA = 3 Then
MsgBox "ci sono tre 1"
End If
If contB = 2 Then
MsgBox "ci sono due 2"
ElseIf contB = 3 Then
MsgBox "ci sono tre 2"
End If
If contC = 2 Then
MsgBox "ci sono due 3"
ElseIf contC = 3 Then
MsgBox "ci sono tre 3"
End If
If contA = 1 And contB = 1 Then
MsgBox "ci sono tre numeri diversi"
End If
End Sub
Private Sub Command2_Click()
End
End Sub
il mio form è composto da un array di tre caselle di testo un button e una quarta casella dove mettere un punteggio.
io sono riuscita a far si che uscisse una casella msgbox...ma se volesssi far incrementare un punteggio invece di far uscire la casella come devo fare?