DagNachtklok: code
- Om de tijd te tonen en na te gaan of het dag of nacht is.
Private Sub Timer1_Timer()
Dim uur As Integer
uur = Format(Now, "h")
If uur > 7 And uur < 20 Then
zon
Else
maan
End If
lblTijd.Caption = uur Mod 12 & Format(Now, ":nn:ss")
End Sub
- Om het icoon te veranderen gebruiken we een procedure.
Sub zon()
Me.Icon = ImageList1.ListImages.Item(1).Picture
End Sub
Sub maan()
Me.Icon = ImageList1.ListImages.Item(2).Picture
End Sub
[VB Web] - [hlrnet] - [copyright]