디지탈 시계를 만들어보자
*
Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
Timer1.Interval = 1000
Me.BackColor = Color.Black
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Now.Second = 0 Then
E1.Visible = True
E2.Visible = False
E3.Visible = True
E4.Visible = True
E5.Visible = True
E6.Visible = True
E7.Visible = True
F1.Visible = True
F2.Visible = False
F3.Visible = True
F4.Visible = True
F5.Visible = True
F6.Visible = True
F7.Visible = True
End If

If Now.Second = 1 Then
E1.Visible = True
E2.Visible = False
E3.Visible = True
E4.Visible = True
E5.Visible = True
E6.Visible = True
E7.Visible = True
F1.Visible = False
F2.Visible = False
F3.Visible = False
F4.Visible = False
F5.Visible = False
F6.Visible = True
F7.Visible = True
End If

If Now.Second = 2 Then
E1.Visible = True
E2.Visible = False
E3.Visible = True
E4.Visible = True
E5.Visible = True
E6.Visible = True
E7.Visible = True
F1.Visible = True
F2.Visible = True
F3.Visible = True
F4.Visible = False
F5.Visible = True
F6.Visible = False
F7.Visible = True
End If

If Now.Second = 3 Then
E1.Visible = True
E2.Visible = False
E3.Visible = True
E4.Visible = True
E5.Visible = True
E6.Visible = True
E7.Visible = True
F1.Visible = True
F2.Visible = True
F3.Visible = True
F4.Visible = False
F5.Visible = False
F6.Visible = True
F7.Visible = True
End If

If Now.Second = 4 Then
E1.Visible = True
E2.Visible = False
E3.Visible = True
E4.Visible = True
E5.Visible = True
E6.Visible = True
E7.Visible = True
F1.Visible = False
F2.Visible = True
F3.Visible = False
F4.Visible = True
F5.Visible = False
F6.Visible = True
F7.Visible = True
End If

If Now.Second = 5 Then
E1.Visible = True
E2.Visible = False
E3.Visible = True
E4.Visible = True
E5.Visible = True
E6.Visible = True
E7.Visible = True
F1.Visible = True
F2.Visible = True
F3.Visible = True
F4.Visible = True
F5.Visible = False
F6.Visible = True
F7.Visible = False
End If

If Now.Second = 6 Then
E1.Visible = True
E2.Visible = False
E3.Visible = True
E4.Visible = True
E5.Visible = True
E6.Visible = True
E7.Visible = True
F1.Visible = False
F2.Visible = True
F3.Visible = True
F4.Visible = True
F5.Visible = True
F6.Visible = True
F7.Visible = False
End If

If Now.Second = 7 Then
E1.Visible = True
E2.Visible = False
E3.Visible = True
E4.Visible = True
E5.Visible = True
E6.Visible = True
E7.Visible = True
F1.Visible = True
F2.Visible = False
F3.Visible = False
F4.Visible = False
F5.Visible = False
F6.Visible = True
F7.Visible = True
End If

If Now.Second = 8 Then
E1.Visible = True
E2.Visible = False
E3.Visible = True
E4.Visible = True
E5.Visible = True
E6.Visible = True
E7.Visible = True
F1.Visible = True
F2.Visible = True
F3.Visible = True
F4.Visible = True
F5.Visible = True
F6.Visible = True
F7.Visible = True
End If

If Now.Second = 9 Then
E1.Visible = True
E2.Visible = False
E3.Visible = True
E4.Visible = True
E5.Visible = True
E6.Visible = True
E7.Visible = True
F1.Visible = True
F2.Visible = True
F3.Visible = False
F4.Visible = True
F5.Visible = False
F6.Visible = True
F7.Visible = True
End If

If Now.Second = 10 Then
E1.Visible = False
E2.Visible = False
E3.Visible = False
E4.Visible = False
E5.Visible = False
E6.Visible = True
E7.Visible = True
F1.Visible = True
F2.Visible = False
F3.Visible = True
F4.Visible = True
F5.Visible = True
F6.Visible = True
F7.Visible = True
End If

If Now.Second = 11 Then
E1.Visible = False
E2.Visible = False
E3.Visible = False
E4.Visible = False
E5.Visible = False
E6.Visible = True
E7.Visible = True
F1.Visible = False
F2.Visible = False
F3.Visible = False
F4.Visible = False
F5.Visible = False
F6.Visible = True
F7.Visible = True
End If

End Sub
End Class

* 약간(?)의 노가다성이 있는 코드 입니다

* 코드의 일부만 올려 놨습니다

* 동영상에서는 픽처박스를 사용 했는데 다른 컨트롤도 사용 해보세요

* 코드가 너무 길어 기본기능 코드를 첨부했습니다. => 20141031-디지털시계.zip  

* 추가기능을 넣어 보세요(글자 색상선택, 알람기능 등..)

 

2.png

 1.png

2.png

* 시계를 클릭하면 테두리가 사라지고 다시 클릭하면 보이게 했습니다


 

이 게시물을

댓글'1'

이 댓글을

공유하기

SEARCH

MENU NAVIGATION