Horloge digital

Description

aucun probleme d'installation puisque l'horloge se met a jour en fonction de votre heure systeme.

il faut just créér des "shapes" indexés (shape1: 60 index, shape2: 27 index, shape3: 2 index)
et mettre deux timers. le timer1 a un intervalle d' 1 seconde et le timer2 de 60 secondes.

Source / Exemple :


Private Sub Timer1_Timer()
If Shape3(0).FillColor = &HFF& And Shape3(1).FillColor = &HFF& Then
Shape3(0).FillColor = &H0
Shape3(1).FillColor = &H0
Else
Shape3(0).FillColor = &HFF
Shape3(1).FillColor = &HFF
End If
i = Second(Now)
If i = 0 Then
Shape1(60).FillColor = &H0
i = 60
End If
If i < 60 Then
Shape1(i).FillColor = &HFF
Else
For r = 1 To 60
Shape1(r).FillColor = &H0
Next r
i = 0
End If
End Sub

Private Sub Timer2_Timer()
Dim op(3)
Dim u(6)
Static b, c, d, e
a = Time
b = Mid(a, 1, 1) 'dizaine
c = Mid(a, 2, 1) 'unite
d = Mid(a, 4, 1) 'dizaine
e = Mid(a, 5, 1) 'unite

op(0) = b
op(1) = c
op(2) = d
op(3) = e

u(0) = 0
u(1) = 1
u(2) = 2
u(3) = 3
u(4) = 4
u(5) = 5
u(6) = 6

Call clear
For i = 0 To 3

For t = 0 To 6
u(t) = t + (i * 7)
Next t

z = op(i)

If z = 0 Then
Shape2(u(0)).FillColor = &HFF&
Shape2(u(2)).Visible = False
Shape2(u(1)).FillColor = &HFF&
Shape2(u(5)).FillColor = &HFF&
Shape2(u(6)).FillColor = &HFF&
Shape2(u(4)).FillColor = &HFF&
Shape2(u(3)).FillColor = &HFF&
End If
If z = 1 Then
Shape2(u(0)).Visible = False
Shape2(u(1)).FillColor = &HFF&
Shape2(u(5)).FillColor = &HFF&
Shape2(u(2)).Visible = False
Shape2(u(3)).Visible = False
Shape2(u(4)).Visible = False
Shape2(u(6)).Visible = False

End If
If z = 2 Then
Shape2(u(0)).FillColor = &HFF&
Shape2(u(1)).FillColor = &HFF&
Shape2(u(2)).FillColor = &HFF&
Shape2(u(4)).FillColor = &HFF&
Shape2(u(6)).FillColor = &HFF&
Shape2(u(3)).Visible = False
Shape2(u(5)).Visible = False
End If
If z = 3 Then
Shape2(u(0)).FillColor = &HFF&
Shape2(u(1)).FillColor = &HFF&
Shape2(u(2)).FillColor = &HFF&
Shape2(u(5)).FillColor = &HFF&
Shape2(u(6)).FillColor = &HFF&
Shape2(u(3)).Visible = False
Shape2(u(4)).Visible = False
End If
If z = 4 Then
'Call clear
Shape2(u(3)).FillColor = &HFF&
Shape2(u(1)).FillColor = &HFF&
Shape2(u(2)).FillColor = &HFF&
Shape2(u(5)).FillColor = &HFF&
Shape2(u(0)).Visible = False
Shape2(u(4)).Visible = False
Shape2(u(6)).Visible = False
End If
If z = 5 Then
Shape2(u(0)).FillColor = &HFF&
Shape2(u(3)).FillColor = &HFF&
Shape2(u(2)).FillColor = &HFF&
Shape2(u(5)).FillColor = &HFF&
Shape2(u(6)).FillColor = &HFF&
Shape2(u(4)).Visible = False
Shape2(u(1)).Visible = False
End If
If z = 6 Then
Shape2(u(0)).FillColor = &HFF&
Shape2(u(3)).FillColor = &HFF&
Shape2(u(4)).FillColor = &HFF&
Shape2(u(6)).FillColor = &HFF&
Shape2(u(5)).FillColor = &HFF&
Shape2(u(2)).FillColor = &HFF&
Shape2(u(1)).Visible = False
End If
If z = 7 Then
Shape2(u(0)).FillColor = &HFF&
Shape2(u(1)).FillColor = &HFF&
Shape2(u(5)).FillColor = &HFF&
Shape2(u(2)).Visible = False
Shape2(u(3)).Visible = False
Shape2(u(4)).Visible = False
Shape2(u(6)).Visible = False
End If
If z = 8 Then
For c = 0 To 6
Shape2(u(c)).FillColor = &HFF&
Next c
End If
If z = 9 Then
Shape2(u(0)).FillColor = &HFF&
Shape2(u(1)).FillColor = &HFF&
Shape2(u(2)).FillColor = &HFF&
Shape2(u(3)).FillColor = &HFF&
Shape2(u(5)).FillColor = &HFF&
Shape2(u(6)).FillColor = &HFF&
Shape2(u(4)).Visible = False
End If
Next i
End Sub

Public Sub clear()
Dim ob As Object
For Each ob In Shape2
ob.FillColor = &H0&
ob.Visible = True
Next ob
End Sub

Conclusion :


voila, finalement je l'ai mis a jour!
merci pour le petit coup de main d'une personne etant venu me laisser un message! ;o)

Codes Sources

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.