Option Explicit
Dim x As Integer
Dim y As Integer
Dim i As Integer
Private Sub Command1_Click()
Label1.Caption = CInt(Int((x - y + 1) * Rnd() + y))
Text1.SetFocus
End Sub
Private Sub Command2_Click()
i = i - 1
txtTentativi.Text = i
If Text1.Text > Label1.Caption Then
lblScore.Caption = "Pių piccolo"
End If
If Text1.Text < Label1.Caption Then
lblScore.Caption = "Pių grande"
End If
If Text1.Text = Label1.Caption Then
lblScore.Caption = "Vittoria!"
Image1.Visible = False
Label1.Visible = True
End If
If IsNumeric(Text1.Text) Then
Else
Errore
End If
If i <= 0 Then
MsgBox "Hai perso", vbDefaultButton1, "Lose"
End If
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Command4_Click()
frmGioco.Hide
FrmOrologio.Show
End Sub
Private Sub Command5_Click()
Text1.Text = ""
lblScore.Caption = ""
Image1.Visible = True
Label1.Visible = False
txtTentativi.Text = ""
i = 7
End Sub
Private Sub Form_Load()
Randomize
x = 100
y = 0
i = 7
End Sub
Public Sub Errore()
MsgBox "Si č verificato un errore nell'applicazione.", vbCritical, "Errore"
End
End Sub