Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Clock! - frmGioco.frm

frmGioco.frm

Caricato da: Roberto VB
Scarica il programma completo

  1. Option Explicit
  2. Dim x As Integer
  3. Dim y As Integer
  4. Dim i As Integer
  5. Private Sub Command1_Click()
  6. Label1.Caption = CInt(Int((x - y + 1) * Rnd() + y))
  7. Text1.SetFocus
  8.  
  9. End Sub
  10.  
  11. Private Sub Command2_Click()
  12. i = i - 1
  13. txtTentativi.Text = i
  14. If Text1.Text > Label1.Caption Then
  15. lblScore.Caption = "Pių piccolo"
  16. End If
  17. If Text1.Text < Label1.Caption Then
  18. lblScore.Caption = "Pių grande"
  19. End If
  20. If Text1.Text = Label1.Caption Then
  21. lblScore.Caption = "Vittoria!"
  22. Image1.Visible = False
  23. Label1.Visible = True
  24. End If
  25.  
  26. If IsNumeric(Text1.Text) Then
  27. Else
  28. Errore
  29. End If
  30.  
  31. If i <= 0 Then
  32. MsgBox "Hai perso", vbDefaultButton1, "Lose"
  33. End If
  34.  
  35.  
  36. End Sub
  37.  
  38. Private Sub Command3_Click()
  39. End
  40. End Sub
  41.  
  42. Private Sub Command4_Click()
  43. frmGioco.Hide
  44. FrmOrologio.Show
  45. End Sub
  46.  
  47. Private Sub Command5_Click()
  48. Text1.Text = ""
  49. lblScore.Caption = ""
  50. Image1.Visible = True
  51. Label1.Visible = False
  52. txtTentativi.Text = ""
  53. i = 7
  54. End Sub
  55.  
  56. Private Sub Form_Load()
  57. Randomize
  58. x = 100
  59. y = 0
  60. i = 7
  61. End Sub
  62.  
  63. Public Sub Errore()
  64. MsgBox "Si č verificato un errore nell'applicazione.", vbCritical, "Errore"
  65. End
  66. End Sub