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 - Form1.frm

Form1.frm

Caricato da: Natamas
Scarica il programma completo

  1. Option Explicit
  2.  
  3. Private Sub avv_Click()
  4. If az = 1 Then
  5. Timer1.Enabled = True
  6. avv.Caption = "Pausa"
  7. az = 2
  8. ElseIf az = 2 Then
  9. Timer1.Enabled = False
  10. avv.Caption = "Avvia"
  11. az = 1
  12. End If
  13. End Sub
  14.  
  15. Private Sub Form_Load()
  16. Call Control_windows
  17. Me.Caption = App.Title & " " & App.Major & "." & App.Minor
  18. az = 1
  19. Call azzera
  20. End Sub
  21.  
  22. Private Sub Form_Unload(Cancel As Integer)
  23. Unload Form2
  24. Unload Me
  25. End
  26. End Sub
  27.  
  28. Private Sub mod_Click()
  29. nul = 1
  30. Form2.Show 1
  31. End Sub
  32.  
  33. Private Sub res_Click()
  34. Timer1.Enabled = False
  35. az = 1
  36. avv.Caption = "Avvia"
  37. Call azzera
  38. End Sub
  39.  
  40. Sub azzera()
  41. sec = Form2.secondi.Text
  42. min = Form2.minuti.Text
  43. ore = Form2.orer.Text
  44. cron = Form2.giorni.Text
  45. sec_t.Caption = sec
  46. min_t.Caption = min
  47. ore_t.Caption = ore
  48. cron_t.Caption = cron
  49. Call Controlla
  50. End Sub
  51.  
  52. Private Sub Timer1_Timer()
  53. Call Cronometro
  54. Call Controlla
  55. End Sub
  56.  
  57. Sub Cronometro()
  58. 'inizio secondi
  59. If sec = 0 Then
  60. If min = 0 Then
  61. If ore = 0 Then
  62. If cron = 0 Then
  63. If Form2.nada.Value = True Then
  64. MsgBox "Conto alla rovescia eseguito con successo!", vbInformation, App.Title
  65. ElseIf Form2.filee.Value = True Then
  66. glPid = Shell(filedir, vbNormalFocus)
  67. Timer2.Enabled = True
  68. ElseIf Form2.spegn.Value = True Then
  69. Call Shutdown(EWX_POWEROFF)
  70. Timer2.Enabled = True
  71. ElseIf Form2.riav.Value = True Then
  72. Call Shutdown(EWX_REBOOT)
  73. Timer2.Enabled = True
  74. End If
  75. Timer1.Enabled = False
  76. az = 1
  77. avv.Caption = "Avvia"
  78. Call azzera
  79. Else
  80. cron = cron - 1
  81. ore = 23
  82. min = 59
  83. sec = 59
  84. ore_t.Caption = ore
  85. cron_t.Caption = cron
  86. min_t.Caption = min
  87. sec_t.Caption = sec
  88. End If
  89. '--------
  90. Else
  91. ore = ore - 1
  92. min = 59
  93. sec = 59
  94. min_t.Caption = min
  95. ore_t.Caption = ore
  96. sec_t.Caption = sec
  97. End If
  98. '--------
  99. Else
  100. min = min - 1
  101. sec = 59
  102. sec_t.Caption = sec
  103. min_t.Caption = min
  104. End If
  105. '--------
  106. Else
  107. sec = sec - 1
  108. sec_t.Caption = sec
  109. End If
  110. 'fine secondi
  111. End Sub
  112.  
  113. Private Sub Timer2_Timer()
  114. Timer2.Enabled = False
  115. Unload Form2
  116. Unload Me
  117. End
  118. End Sub