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
Orologio 7 segmenti - Orologio 7 segmenti.frm

Orologio 7 segmenti.frm

Caricato da: Antometal
Scarica il programma completo

  1. Option Explicit
  2. Dim Seg(9) As String
  3.  
  4. Private Sub Form_DblClick()
  5. Unload Me
  6. End Sub
  7.  
  8. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  9.     If KeyCode = vbKeyEscape Then Unload Me
  10. End Sub
  11.  
  12. Private Sub Form_Load()
  13. Oscura
  14. Seg(0) = "123456"   'corrispondenze tra lettere e numeri dei sengmenti
  15. Seg(1) = "23"       ' _______        _______
  16. Seg(2) = "12457"    '|   a   |      |   1   |
  17. Seg(3) = "12347"    '|f      |b     |6      |2
  18. Seg(4) = "2367"     '|_______|      |_______|
  19. Seg(5) = "13467"    '|   g   |      |   7   |
  20. Seg(6) = "134567"   '|e      |c     |5      |3
  21. Seg(7) = "123"      '|_______|      |_______|
  22. Seg(8) = "1234567"  '    d              4
  23. Seg(9) = "123467"   '
  24. Me.Left = Screen.Width - Me.Width
  25. Me.Top = 0
  26. End Sub
  27.  
  28. Private Sub Oscura()
  29. Dim I As Integer
  30.     For I = 0 To 7 * 14 - 1
  31.         lne(I).Visible = False
  32.     Next I
  33. End Sub
  34.  
  35. Private Sub Numero(Cifra As Integer, Aggiunta As Integer)
  36. Dim I As Integer
  37.     For I = 1 To Len(Seg(Cifra))
  38.         lne(Mid(Seg(Cifra), I, 1) - 1 + Aggiunta).Visible = True
  39.     Next I
  40. End Sub
  41.  
  42. Private Sub Slider1_Change()
  43. MakeTransparent Me.hwnd, Slider1.Value
  44. End Sub
  45.  
  46. Private Sub tmrOra_Timer()
  47. On Error Resume Next
  48. Static Cont As Integer
  49. Dim Cifre(13) As Integer
  50. Dim Ora As String
  51. Dim I As Integer
  52. Oscura
  53. Ora = Format(Now, "hhmmssddmmyyyy")
  54.     For I = 0 To 13
  55.         Cifre(I) = Mid(Ora, I + 1, 1)
  56.         Numero Cifre(I), 7 * I
  57.     Next I
  58. Cont = Cont + 1
  59.     If Cont = 3 Then
  60.             For I = 0 To 3
  61.                 shp(I).Visible = Not (shp(I).Visible)
  62.             Next I
  63.         Cont = 0
  64.     End If
  65. End Sub