Seputar Dunia Teknologi Informasi

Senin, 02 Juli 2012

VB 6.0 : Program Media Player & Horoscope



1.Masukkan kontrol mediaplayer & CommonDialog kedalam form, klik diarea bebas dalam form kemudian ketik kode dibawah ini
Private Sub Form_Load()
   CommonDialog1.Filter = "All Files|*.*"
   CommonDialog1.ShowOpen
 MediaPlayer1.Open CommonDialog1.FileName
End Sub
2. Masukkan CommonButton1 [Keluar] ketik kode seperti ini
Private Sub Command1_Click()
  Unload Me
End Sub 
---------------------------------------------------------------------------------------------------


Private Sub Form_Load()
 Command1.Enabled = False 'Matikan Tombol OK (Command1)
End Sub

Private Sub Text1_Change()
 If IsDate(Text1) Then
  Command1.Enabled = True
 Else
  Command1.Enabled = False
 End If
End Sub
Private Sub Command1_Click()
'Mencari Hari Lahir
Dim KodeHari As Byte
Dim Hari As String
KodeHari = Weekday(Text1)
Select Case KodeHari
Case 1: Hari = "Minggu"
Case 2: Hari = "Senin"
Case 3: Hari = "Selasa"
Case 4: Hari = "Rabu"
Case 5: Hari = "Kamis"
Case 6: Hari = "Jum'at"
Case 7: Hari = "Sabtu"
End Select
Text2 = Hari

'Mencari Bintang
Dim Tg, Bl As Byte
Dim Btg As String
Tg = Day(Text1): Bl = Month(Text1)
If (Tg >= 21 And Bl = 3) Or (Tg <= 20 And Bl = 4) Then Btg = "ARIES"
If (Tg >= 21 And Bl = 4) Or (Tg <= 21 And Bl = 5) Then Btg = "TAURUS"
If (Tg >= 22 And Bl = 5) Or (Tg <= 21 And Bl = 6) Then Btg = "GEMINI"
If (Tg >= 22 And Bl = 6) Or (Tg <= 22 And Bl = 7) Then Btg = "CANCER"
If (Tg >= 23 And Bl = 7) Or (Tg <= 22 And Bl = 8) Then Btg = "LEO"
If (Tg >= 23 And Bl = 8) Or (Tg <= 22 And Bl = 9) Then Btg = "VIRGO"
If (Tg >= 23 And Bl = 9) Or (Tg <= 22 And Bl = 10) Then Btg = "LIBRA"
If (Tg >= 23 And Bl = 10) Or (Tg <= 21 And Bl = 11) Then Btg = "SCORPIO"
If (Tg >= 22 And Bl = 11) Or (Tg <= 21 And Bl = 12) Then Btg = "SAGITARIUS"
If (Tg >= 22 And Bl = 12) Or (Tg <= 20 And Bl = 1) Then Btg = "CAPRICORN"
If (Tg >= 21 And Bl = 1) Or (Tg <= 19 And Bl = 2) Then Btg = "AQUARIUS"
If (Tg >= 20 And Bl = 2) Or (Tg <= 20 And Bl = 3) Then Btg = "PISCES"
Text3 = Btg
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Tidak ada komentar:

Posting Komentar