|
timer的操作如下:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim Timedigit(12) As Integer
Timedigit(0) = DatePart("h", Now) \ 10
Timedigit(1) = DatePart("h", Now) Mod 10
Timedigit(2) = DatePart("n", Now) \ 10
Timedigit(3) = DatePart("n", Now) Mod 10
Timedigit(4) = DatePart("s", Now) \ 10
Timedigit(5) = DatePart("s", Now) Mod 10
Timedigit(6) = (DatePart(DateInterval.Year, Now)) \ 10
Timedigit(7) = (DatePart(DateInterval.Year, Now)) Mod 10
Timedigit(8) = DatePart(DateInterval.Month, Now) \ 10
Timedigit(9) = DatePart(DateInterval.Month, Now) Mod 10
Timedigit(10) = DatePart(DateInterval.Day, Now) \ 10
Timedigit(11) = DatePart(DateInterval.Day, Now) Mod 10
PictureBox1.Image = ImageList1.Images(Timedigit(0))
PictureBox2.Image = ImageList1.Images(Timedigit(1))
PictureBox3.Image = ImageList1.Images(Timedigit(2))
PictureBox4.Image = ImageList1.Images(Timedigit(3))
PictureBox5.Image = ImageList1.Images(Timedigit(4))
PictureBox6.Image = ImageList1.Images(Timedigit(5))
PictureBox16.Image = ImageList1.Images(Timedigit(6))
PictureBox15.Image = ImageList1.Images(Timedigit(7))
PictureBox14.Image = ImageList1.Images(Timedigit(8))
PictureBox13.Image = ImageList1.Images(Timedigit(9))
PictureBox12.Image = ImageList1.Images(Timedigit(10))
PictureBox11.Image = ImageList1.Images(Timedigit(11))
End Sub |
|