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
Conto alla rovescia - Form2.frm

Form2.frm

Caricato da: Natamas
Scarica il programma completo

  1. Option Explicit
  2.  
  3. Private Sub annu_Click()
  4. If nul = 0 Then
  5. Unload Form1
  6. Unload Me
  7. End
  8. Else
  9. Form2.Hide
  10. Form1.Show
  11. End If
  12. End Sub
  13.  
  14. Private Sub filee_Click()
  15. per.Enabled = True
  16. sfo.Enabled = True
  17. End Sub
  18.  
  19. Private Sub Form_Load()
  20. nul = 0
  21. giorni.Text = 0
  22. orer.Text = 0
  23. minuti.Text = 0
  24. secondi.Text = 0
  25. per.Enabled = False
  26. sfo.Enabled = False
  27. End Sub
  28.  
  29. Private Sub giorni_KeyPress(KeyAscii As Integer)
  30. If KeyAscii = 48 Or KeyAscii = 49 Or KeyAscii = 50 Or KeyAscii = 51 Or KeyAscii = 52 _
  31. Or KeyAscii = 53 Or KeyAscii = 54 Or KeyAscii = 55 Or KeyAscii = 56 Or KeyAscii = 57 Or KeyAscii = 8 Then
  32.  
  33. Else
  34.     KeyAscii = 0
  35.     Beep
  36. End If
  37. End Sub
  38.  
  39. Private Sub giorni_LostFocus()
  40. If giorni.Text = "" Then giorni.Text = 0
  41. End Sub
  42.  
  43. Private Sub minuti_KeyPress(KeyAscii As Integer)
  44. If KeyAscii = 48 Or KeyAscii = 49 Or KeyAscii = 50 Or KeyAscii = 51 Or KeyAscii = 52 _
  45. Or KeyAscii = 53 Or KeyAscii = 54 Or KeyAscii = 55 Or KeyAscii = 56 Or KeyAscii = 57 Or KeyAscii = 8 Then
  46.  
  47. Else
  48.     KeyAscii = 0
  49.     Beep
  50. End If
  51. End Sub
  52.  
  53. Private Sub minuti_LostFocus()
  54. If minuti.Text = "" Then minuti.Text = 0
  55. End Sub
  56.  
  57. Private Sub nada_Click()
  58. per.Enabled = False
  59. sfo.Enabled = False
  60. End Sub
  61.  
  62. Private Sub ok_Click()
  63. If giorni.Text = "" Or giorni.Text > 365 Or giorni.Text < 0 Then
  64. MsgBox "Inserire un numero di gioni corretto", vbExclamation, App.Title
  65. ElseIf orer.Text = "" Or orer.Text > 23 Or orer.Text < 0 Then
  66. MsgBox "Inserire un numero di ore corrette", vbExclamation, App.Title
  67. ElseIf minuti.Text = "" Or minuti.Text > 59 Or minuti.Text < 0 Then
  68. MsgBox "Inserire un numero di minuti corretti", vbExclamation, App.Title
  69. ElseIf secondi.Text = "" Or secondi.Text > 59 Or secondi.Text < 0 Then
  70. MsgBox "Inserire un numero di secondi corretti", vbExclamation, App.Title
  71. ElseIf giorni.Text = 0 And orer.Text = 0 And minuti.Text = 0 And secondi.Text = 0 Then
  72. MsgBox "Inserire almeno un numero", vbExclamation, App.Title
  73. ElseIf filee.Value = True And per.Text = "" Then
  74. MsgBox "Selezionare un file da eseguire", vbExclamation, App.Title
  75. Else
  76. Form1.Timer1.Enabled = False
  77. sec = secondi.Text
  78. min = minuti.Text
  79. ore = orer.Text
  80. cron = giorni.Text
  81. Form1.sec_t.Caption = sec
  82. Form1.min_t.Caption = min
  83. Form1.ore_t.Caption = ore
  84. Form1.cron_t.Caption = cron
  85. Call Controlla
  86. az = 1
  87. Form1.avv.Caption = "Avvia"
  88. Form2.Hide
  89. Form1.Show
  90. End If
  91. End Sub
  92.  
  93. Private Sub orer_KeyPress(KeyAscii As Integer)
  94. If KeyAscii = 48 Or KeyAscii = 49 Or KeyAscii = 50 Or KeyAscii = 51 Or KeyAscii = 52 _
  95. Or KeyAscii = 53 Or KeyAscii = 54 Or KeyAscii = 55 Or KeyAscii = 56 Or KeyAscii = 57 Or KeyAscii = 8 Then
  96.  
  97. Else
  98.     KeyAscii = 0
  99.     Beep
  100. End If
  101. End Sub
  102.  
  103. Private Sub orer_LostFocus()
  104. If orer.Text = "" Then orer.Text = 0
  105. End Sub
  106.  
  107. Private Sub riav_Click()
  108. per.Enabled = False
  109. sfo.Enabled = False
  110. End Sub
  111.  
  112. Private Sub secondi_KeyPress(KeyAscii As Integer)
  113. If KeyAscii = 48 Or KeyAscii = 49 Or KeyAscii = 50 Or KeyAscii = 51 Or KeyAscii = 52 _
  114. Or KeyAscii = 53 Or KeyAscii = 54 Or KeyAscii = 55 Or KeyAscii = 56 Or KeyAscii = 57 Or KeyAscii = 8 Then
  115.  
  116. Else
  117.     KeyAscii = 0
  118.     Beep
  119. End If
  120. End Sub
  121.  
  122. Private Sub secondi_LostFocus()
  123. If secondi.Text = "" Then secondi.Text = 0
  124. End Sub
  125.  
  126. Private Sub sfo_Click()
  127. Dialog.ShowOpen
  128. filedir = Dialog.FileName
  129. If filedir = "" Then
  130. MsgBox "Non hai selezionato un file", vbExclamation, App.Title
  131. Else
  132. per.Text = filedir
  133. End If
  134. End Sub
  135.  
  136. Private Sub spegn_Click()
  137. per.Enabled = False
  138. sfo.Enabled = False
  139. End Sub