Posts Subscribe to (PIA BATTA)Comments

Menampilkan Info Hari,Tanggal dan Jam

Saya ingin berbagi untuk menampilkan Info Hari/Taanggal beserta Jam...

Pertama-tama tambahkan komponen FORM,LABEL dan TIMER seperti pada gambar berikut:









Kemudian pada sourcecode buat FUNGSI seperti berikut:

Function GetDateTimeIndo() As String

Dim hr() As String = {"Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"}

Dim bln() As String = {"Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "Nopember", "Desember"}

Dim week As Integer = Weekday(Now.Date, FirstDayOfWeek.Sunday) - 1

Dim month As Integer = Now.Month - 1

Dim hari As String = hr(week)

Dim bulan As String = bln(month)

Return hari & ", " & Now.Day.ToString & " " & bulan & " " & Now.Year.ToString & " Pukul : " & Format(Now(), "hh:mm:ss")

End Function



Kemudian EVENT pada FORM4 LOAD

Private Sub Form4_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Label1.Text = GetDateTimeIndo()

End Sub


Lalu Jalankan Program dan lihat hasilnya...









Semoga bermanfaat......(^_^)>




Semoga bermanfaat....

Categories



Widget by Scrapur

4 komentar:

Anonim mengatakan...

tutornya OK bro...!

Sayidi Putra Mahkota mengatakan...

Mas ko DetikNya g jalan

Owh ya Untuk Pengaturan Timer Nya gmn ???

Anonim mengatakan...

http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/7.gif trus component Timer1 buat apa boss??

Unknown mengatakan...

Private Sub Timer1_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = GetDateTimeIndo()
End Sub

sebelumnya buat enabled menjadi true
agar jam bergerak terus menerus

:)) :)] ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} ~x( :-t b-( :-L x( =))

Posting Komentar

 
Dark Side Blogger Template Copyright 2009 - piaBATTA is proudly powered by Blogger.com Edited By Belajar SEO