Membuat Jam dan Bulan dengan VB

Buatlah form seperti pada gambar dibawah:

Setelah membuat tampilan seperti pada gambar, masukan listing dibawah ini.

Dim sHari As String
Dim aHari

Private Sub Form_Load()
aHari = Array(“Minggu”, “Senin”, “Selasa”, “Rabu”, _
“Kamis”, “Jumat”, “Sabtu”)
Timer1.Interval = 500 ‘Set property interval
Timer1.Enabled = True ‘Aktifkan jika belum…
End Sub

Private Sub Timer1_Timer()
sHari = aHari(Abs(Weekday(Date) – 1))
Label1.Caption = “” & sHari & “, ” _
& Format(Date, “dd mmmm yyyy”)
Label2.Caption = Format(Time, “hh:mm:ss”)
End Sub

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: