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
Media voti - Frmprincipale.frm

Frmprincipale.frm

Caricato da: Albertking82
Scarica il programma completo

  1. Dim somma As Double
  2. Dim numero As Double
  3. Dim risultato As Double
  4. Dim cont As Integer
  5.  
  6. Private Sub Cmdmedia_Click()
  7.  somma = 0
  8.  numero = 0
  9.  cont = 0
  10. If Txtita.Text <> "" And txtstoria.Text <> "" And Txtinglese.Text <> "" And Txtmat.Text <> "" And txtdiritto.Text <> "" And Txtsis.Text <> "" And Txtinf.Text <> "" And Txtcondotta.Text <> "" And Txtaprog.Text <> "" Then
  11. If Val(Txtita.Text) < 6 Then
  12. cont = cont + 1
  13. End If
  14. If Val(txtstoria.Text) < 6 Then
  15. cont = cont + 1
  16. End If
  17. If Val(Txtinglese.Text) < 6 Then
  18. cont = cont + 1
  19. End If
  20. If Val(txtdiritto.Text) < 6 Then
  21. cont = cont + 1
  22. End If
  23. If Val(Txtmat.Text) < 6 Then
  24. cont = cont + 1
  25. End If
  26. If Val(Txtsis.Text) < 6 Then
  27. cont = cont + 1
  28. End If
  29. If Val(Txtinf.Text) < 6 Then
  30. cont = cont + 1
  31. End If
  32. If Val(Txtaprog.Text) < 6 Then
  33. cont = cont + 1
  34. End If
  35. If Val(Txtelet.Text) < 6 Then
  36. cont = cont + 1
  37. End If
  38. If Txtita.Text <> "" Then
  39. somma = somma + CDbl(Txtita.Text)
  40. numero = numero + 1
  41.  Else
  42.  MsgBox "Devi mettere il voto di italiano!", vbInformation, "info"
  43.  End If
  44.  If txtstoria.Text <> "" Then
  45. somma = somma + CDbl(txtstoria.Text)
  46. numero = numero + 1
  47.  Else
  48.  MsgBox "Devi mettere il voto di storia!", vbInformation, "info"
  49.  End If
  50.  If Txtinglese.Text <> "" Then
  51. somma = somma + CDbl(Txtinglese.Text)
  52. numero = numero + 1
  53.  Else
  54.  MsgBox "Devi mettere il voto d'inglese!", vbInformation, "info"
  55.  End If
  56.   If txtdiritto.Text <> "" Then
  57. somma = somma + CDbl(txtdiritto.Text)
  58. numero = numero + 1
  59.  Else
  60.  MsgBox "Devi mettere il voto di diritto!", vbInformation, "info"
  61.  End If
  62.   If Txtmat.Text <> "" Then
  63. somma = somma + CDbl(Txtmat.Text)
  64. numero = numero + 1
  65.  Else
  66.  MsgBox "Devi mettere il voto di matematica!", vbInformation, "info"
  67.  End If
  68.   If Txtelet.Text <> "" Then
  69. somma = somma + CDbl(Txtelet.Text)
  70. numero = numero + 1
  71.  Else
  72.  MsgBox "Devi mettere il voto di elettronica!", vbInformation, "info"
  73.  End If
  74.   If Txtinf.Text <> "" Then
  75. somma = somma + CDbl(Txtinf.Text)
  76. numero = numero + 1
  77.  Else
  78.  MsgBox "Devi mettere il voto di informatica!", vbInformation, "info"
  79.  End If
  80.   If Txtsis.Text <> "" Then
  81. somma = somma + CDbl(Txtsis.Text)
  82. numero = numero + 1
  83.  Else
  84.  MsgBox "Devi mettere il voto di sistemi!", vbInformation, "info"
  85.  End If
  86.   If Txtaprog.Text <> "" Then
  87. somma = somma + CDbl(Txtaprog.Text)
  88. numero = numero + 1
  89.  Else
  90.  MsgBox "Devi mettere il voto di Area Progetto", vbInformation, "info"
  91.  End If
  92.   If Txtcondotta.Text <> "" Then
  93. somma = somma + CDbl(Txtcondotta.Text)
  94. numero = numero + 1
  95.  Else
  96.  MsgBox "Devi mettere il voto di condotta!", vbInformation, "info"
  97.  End If
  98.  risultato = CDbl(somma / numero)
  99.  If cont >= 4 Then
  100.    Label27.Caption = "L'alunno è stato bocciato"
  101.    Label26.Caption = ""
  102.    Else
  103.    Label27.Caption = "L'alunno è stato promosso"
  104.    Label26.Caption = CDbl(risultato)
  105.    End If
  106. End If
  107.  
  108. End Sub
  109.  
  110. Private Sub Command1_Click()
  111. Cmdmedia.SetFocus
  112. Txtita.Text = ""
  113. txtstoria.Text = ""
  114. Txtinglese.Text = ""
  115. txtdiritto.Text = ""
  116. Txtsis.Text = ""
  117. Txtinf.Text = ""
  118. Txtaprog.Text = ""
  119. Txtcondotta.Text = ""
  120. Txtelet.Text = ""
  121. Txtmat.Text = ""
  122. Label26.Caption = ""
  123. Label27.Caption = ""
  124. End Sub
  125.  
  126. Private Sub Form_DblClick()
  127. Frmprincipale.WindowState = 2
  128.  
  129. End Sub
  130.  
  131. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  132.  Dim ris As Integer
  133.  If KeyCode = 27 Then
  134.   ris = MsgBox("Sei sicuro di voler uscire?", vbInformation + vbYesNo, "Esci")
  135.  If ris = vbYes Then
  136.   MsgBox "BY ALBERT KING!!!(04\04\2006)", vbInformation, "Esci"
  137.   End
  138.  End If
  139.  End If
  140.  If KeyCode = 112 Then
  141.  frmaiuto.Show
  142.  End If
  143. End Sub
  144.  
  145. Private Sub Form_Load()
  146. somma = 0
  147. numero = 0
  148. cont = 0
  149. End Sub
  150.  
  151. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  152.  If MsgBox("Sei sicuro di voler uscire?", vbInformation + vbYesNo, "Esci") = vbYes Then
  153.   MsgBox "BY ALBERT KING!!!", vbInformation, "Esci"
  154.   End
  155.  Else
  156.   Cancel = True
  157.  End If
  158. End Sub
  159.  
  160. Private Sub mnucancella_Click()
  161. Cmdmedia.SetFocus
  162. Txtita.Text = ""
  163. txtstoria.Text = ""
  164. Txtinglese.Text = ""
  165. txtdiritto.Text = ""
  166. Txtsis.Text = ""
  167. Txtinf.Text = ""
  168. Txtaprog.Text = ""
  169. Txtcondotta.Text = ""
  170. Txtelet.Text = ""
  171. Txtmat.Text = ""
  172. Label26.Caption = ""
  173. Label27.Caption = ""
  174. End Sub
  175.  
  176. Private Sub mnuesci_Click()
  177.  Dim ris As Integer
  178.   ris = MsgBox("Sei sicuro di voler uscire?", vbInformation + vbYesNo, "Esci")
  179.  If ris = vbYes Then
  180.   MsgBox "BY ALBERT KING!!!(04\04\2006)", vbInformation, "Esci"
  181.   End
  182.  End If
  183. End Sub
  184.  
  185. Private Sub Txtaprog_Change()
  186. If IsNumeric(Txtaprog.Text) Then
  187. If Val(Txtaprog.Text) > 10 Then
  188.  MsgBox "Numero troppo grande!!", vbInformation, "info"
  189.  Txtaprog.Text = ""
  190.  End If
  191.  Else
  192.  Txtaprog.Text = ""
  193.  End If
  194. End Sub
  195.  
  196. Private Sub Txtaprog_KeyDown(KeyCode As Integer, Shift As Integer)
  197.  If KeyCode = 190 Then
  198.   MsgBox " Devi utilizzare la virgola!!!", vbInformation, "Esci"
  199.   Txtaprog.Text = ""
  200.  End If
  201. End Sub
  202.  
  203. Private Sub Txtcondotta_Change()
  204.  If IsNumeric(Txtcondotta.Text) = False Then
  205.   Txtcondotta.Text = ""
  206.  End If
  207. End Sub
  208.  
  209. Private Sub Txtcondotta_KeyDown(KeyCode As Integer, Shift As Integer)
  210.  If KeyCode = 190 Then
  211.   MsgBox " Devi utilizzare la virgola!!!", vbInformation, "Esci"
  212.   Txtcondotta.Text = ""
  213.  End If
  214. End Sub
  215.  
  216. Private Sub txtdiritto_Change()
  217.  If IsNumeric(txtdiritto.Text) Then
  218.   If Val(txtdiritto.Text) > 10 Then
  219.    MsgBox "Numero troppo grande!!", vbInformation, "info"
  220.    txtdiritto.Text = ""
  221.   End If
  222.  Else
  223.   txtdiritto.Text = ""
  224.  End If
  225. End Sub
  226.  
  227. Private Sub txtdiritto_KeyDown(KeyCode As Integer, Shift As Integer)
  228.  If KeyCode = 190 Then
  229.   MsgBox " Devi utilizzare la virgola!!!", vbInformation, "Esci"
  230.   txtdiritto.Text = ""
  231.  End If
  232. End Sub
  233.  
  234. Private Sub Txtelet_Change()
  235.  If IsNumeric(Txtelet.Text) Then
  236.   If Val(Txtelet.Text) > 10 Then
  237.    MsgBox "Numero troppo grande!!", vbInformation, "info"
  238.    Txtelet.Text = ""
  239.   End If
  240.  Else
  241.   Txtelet.Text = ""
  242.  End If
  243. End Sub
  244.  
  245. Private Sub Txtelet_KeyDown(KeyCode As Integer, Shift As Integer)
  246.  If KeyCode = 190 Then
  247.   MsgBox " Devi utilizzare la virgola!!!", vbInformation, "Esci"
  248.   Txtelet.Text = ""
  249.  End If
  250. End Sub
  251.  
  252. Private Sub Txtinf_Change()
  253. If IsNumeric(Txtinf.Text) Then
  254.  If Val(Txtinf.Text) > 10 Then
  255.   MsgBox "Numero troppo grande!!", vbInformation, "info"
  256.   Txtinf.Text = ""
  257.  End If
  258.  Else
  259.  Txtinf.Text = ""
  260.   End If
  261. End Sub
  262.  
  263. Private Sub Txtinf_KeyDown(KeyCode As Integer, Shift As Integer)
  264.  If KeyCode = 190 Then
  265.   MsgBox " Devi utilizzare la virgola!!!", vbInformation, "Esci"
  266.   Txtinf.Text = ""
  267.  End If
  268. End Sub
  269.  
  270. Private Sub Txtinglese_Change()
  271. If IsNumeric(Txtinglese.Text) Then
  272.  If Val(Txtinglese.Text) > 10 Then
  273.   MsgBox "Numero troppo grande!!", vbInformation, "info"
  274.   Txtinglese.Text = ""
  275.  End If
  276.  Else
  277.   Txtinglese.Text = ""
  278.  End If
  279. End Sub
  280.  
  281. Private Sub Txtinglese_KeyDown(KeyCode As Integer, Shift As Integer)
  282.  If KeyCode = 190 Then
  283.   MsgBox " Devi utilizzare la virgola!!!", vbInformation, "Esci"
  284.   Txtinglese.Text = ""
  285. End If
  286. End Sub
  287.  
  288. Private Sub Txtita_Change()
  289. If IsNumeric(Txtita.Text) Then
  290.  If Val(Txtita.Text) > 10 Then
  291.   MsgBox "Numero troppo grande!!", vbInformation, "info"
  292.   Txtita.Text = ""
  293.   End If
  294.  Else
  295.  Txtita.Text = ""
  296.  End If
  297. End Sub
  298.  
  299. Private Sub Txtita_KeyDown(KeyCode As Integer, Shift As Integer)
  300.  If KeyCode = 190 Then
  301.   MsgBox " Devi utilizzare la virgola!!!", vbInformation, "Esci"
  302.   Txtita.Text = ""
  303. End If
  304. End Sub
  305.  
  306. Private Sub Txtmat_Change()
  307. If IsNumeric(Txtmat.Text) Then
  308.  If Val(Txtmat.Text) > 10 Then
  309.   MsgBox "Numero troppo grande!!", vbInformation, "info"
  310.   Txtmat.Text = ""
  311.  End If
  312.   Else
  313.   Txtmat.Text = ""
  314.  End If
  315. End Sub
  316.  
  317. Private Sub Txtmat_KeyDown(KeyCode As Integer, Shift As Integer)
  318.  If KeyCode = 190 Then
  319.   MsgBox " Devi utilizzare la virgola!!!", vbInformation, "Esci"
  320.   Txtmat.Text = ""
  321.  End If
  322. End Sub
  323.  
  324. Private Sub Txtsis_Change()
  325. If IsNumeric(Txtsis.Text) Then
  326.  If Val(Txtsis.Text) > 10 Then
  327.   MsgBox "Numero troppo grande!!", vbInformation, "info"
  328.   Txtsis.Text = ""
  329.  End If
  330.  Else
  331.   Txtsis.Text = ""
  332.  End If
  333. End Sub
  334.  
  335. Private Sub Txtsis_KeyDown(KeyCode As Integer, Shift As Integer)
  336.  If KeyCode = 190 Then
  337.   MsgBox " Devi utilizzare la virgola!!!", vbInformation, "Esci"
  338.   Txtsis.Text = ""
  339.  End If
  340. End Sub
  341.  
  342. Private Sub txtstoria_Change()
  343. If IsNumeric(txtstoria.Text) Then
  344.  If Val(txtstoria.Text) > 10 Then
  345.   MsgBox "Numero troppo grande!!", vbInformation, "info"
  346.   txtstoria.Text = ""
  347.   End If
  348.   Else
  349.   txtstoria.Text = ""
  350.  End If
  351. End Sub
  352.  
  353. Private Sub txtstoria_KeyDown(KeyCode As Integer, Shift As Integer)
  354.  If KeyCode = 190 Then
  355.   MsgBox " Devi utilizzare la virgola!!!", vbInformation, "Esci"
  356.   txtstoria.Text = ""
  357.  End If
  358. End Sub