Rabu, 04 Mei 2011

program zodiak dengan visual basic

listing programnya

Dim a As Integer
Dim b As Integer
Dim f As Integer
Dim kabisat As Boolean

Private Sub Combo2_Click()
If Me.Combo2.Text = "Februari" Then
   If kabisat = True Then
      a = 29
   Else
      a = 28
   End If
ElseIf Me.Combo2.Text = "Januari" Or Me.Combo2.Text = "Maret" Or Me.Combo2.Text = "Mei" Or Me.Combo2.Text = "Juli" Or Me.Combo2.Text = "Agustus" Or Me.Combo2.Text = "Oktober" Or Me.Combo2.Text = "Desember" Then
    a = 31
Else
    a = 30

End If

Me.Combo1.Clear
For b = 1 To a
    Me.Combo1.AddItem (b)
Next b


End Sub


Private Sub Combo3_Click()
Me.Combo2.Clear
Me.Combo2.AddItem ("Januari")
Me.Combo2.AddItem ("Februari")
Me.Combo2.AddItem ("Maret")
Me.Combo2.AddItem ("April")
Me.Combo2.AddItem ("Mei")
Me.Combo2.AddItem ("Juni")
Me.Combo2.AddItem ("Juli")
Me.Combo2.AddItem ("Agustus")
Me.Combo2.AddItem ("September")
Me.Combo2.AddItem ("Oktober")
Me.Combo2.AddItem ("November")
Me.Combo2.AddItem ("Desember")
e = Me.Combo3.Text
f = e Mod 4
If f = 0 Then
   kabisat = True
Else
   kabisat = False

End If
End Sub


Private Sub Command1_Click()
Dim c As String
Dim img1, img2, img3, img4, img5, img6, img7, img8, img9, img10, img11, img12 As String

If (Me.Combo2.Text = "Desember" And Me.Combo1.Text >= 22) Or (Me.Combo2.Text = "Januari" And Me.Combo1.Text <= 20) Then
     c = "CAPRICORN"
     Me.Text3.Text = "22 Desember - 20 Januari"
     Me.Text2.Text = "Karakter: gengsi tinggi, rajin, pendiam, materialis, teguh pendirian, ambisius, suka memerintah, dan mampu mengorganisir teman-temannya."
     Me.Text2.FontSize = 15
     Me.Text2.FontBold = True
     img1 = "capricorn-03.gif"
     Me.Image1.Picture = LoadPicture("D:\ARIN\VB\zodiak\" + img1)
    
ElseIf (Me.Combo2.Text = "Januari" And Me.Combo1.Text >= 21) Or (Me.Combo2.Text = "Februari" And Me.Combo1.Text <= 19) Then
     c = "AQUARIUS"
     Me.Text3.Text = "21 Januari - 19 Februari"
     Me.Text2.Text = "Karakter: jenius, tenang, penuh ide, obyektif (tidak memihak), cepat mengerti"
     Me.Text2.FontSize = 15
     Me.Text2.FontBold = True
     img2 = "aquarius-03.gif"
     Me.Image1.Picture = LoadPicture("D:\ARIN\VB\zodiak\" + img2)
    
ElseIf (Me.Combo2.Text = "Februari" And Me.Combo1.Text >= 20) Or (Me.Combo2.Text = "Maret" And Me.Combo1.Text <= 20) Then
     c = "PISCES"
     Me.Text3.Text = "20 Februari - 20 Maret"
     Me.Text2.Text = "Karakter: penuh cinta, praktis, memiliki sisi manusiawi yang besar, suka mengkhayal"
     Me.Text2.FontSize = 15
     Me.Text2.FontBold = True
     img3 = "pisces-03.gif"
     Me.Image1.Picture = LoadPicture("D:\ARIN\VB\zodiak\" + img3)
ElseIf (Me.Combo2.Text = "Maret" And Me.Combo1.Text >= 21) Or (Me.Combo2.Text = "April" And Me.Combo1.Text <= 19) Then
     c = "ARIES"
     Me.Text3.Text = "21 Maret-19 April"
     Me.Text2.Text = " Karakter: energik, cepat emosi, agresif, impulsif, berjiwa pemimpin, tidak sabaran, egois "
     Me.Text2.FontSize = 15
     Me.Text2.FontBold = True
     img4 = "aries-03.gif"
     Me.Image1.Picture = LoadPicture("D:\ARIN\VB\zodiak\" + img4)
ElseIf (Me.Combo2.Text = "April" And Me.Combo1.Text >= 20) Or (Me.Combo2.Text = "Mei" And Me.Combo1.Text <= 20) Then
     c = "TAURUS"
     Me.Text3.Text = "21 April-20 Mei"
     Me.Text2.Text = " Karakter : materialistis, keras kepala, pasif, praktis dan setia, ramah & sabar, memiliki jiwa toleransi"
     Me.Text2.FontSize = 15
     Me.Text2.FontBold = True
     img5 = "taurus-03.gif"
     Me.Image1.Picture = LoadPicture("D:\ARIN\VB\zodiak\" + img5)
ElseIf (Me.Combo2.Text = "Mei" And Me.Combo1.Text >= 21) Or (Me.Combo2.Text = "Juni" And Me.Combo1.Text <= 21) Then
     c = "GEMINI"
     Me.Text3.Text = "21 Mei-21 Juni"
     Me.Text2.Text = "Karakter: pandai berbicara, lincah, mudah berubah-ubah, tidak stabil, mudah gugup, sangat peka"
     Me.Text2.FontSize = 15
     Me.Text2.FontBold = True
     img6 = "gemini-03.gif"
     Me.Image1.Picture = LoadPicture("D:\ARIN\VB\zodiak\" + img6)
ElseIf (Me.Combo2.Text = "Juni" And Me.Combo1.Text >= 22) Or (Me.Combo2.Text = "Juli" And Me.Combo1.Text <= 22) Then
     c = "CANCER"
     Me.Text3.Text = "22 Juni-22 Juli"
     Me.Text2.Text = "Karakter: setia, penuh perhatian, sulit memaafkan, memiliki daya ingat yang kuat, suasana hati tidak menentu, sentimentil,"
     Me.Text2.FontSize = 15
     Me.Text2.FontBold = True
     img7 = "cancer-03.gif"
     Me.Image1.Picture = LoadPicture("D:\ARIN\VB\zodiak\" + img7)
ElseIf (Me.Combo2.Text = "Juli" And Me.Combo1.Text >= 23) Or (Me.Combo2.Text = "Agustus" And Me.Combo1.Text <= 23) Then
     c = "LEO"
     Me.Text3.Text = "23 Juli-23 Agustus"
     Me.Text2.Text = "Karakter: suasana hati sering berubah, setia, penuh perhatian, sentimentil, sulit memaafkan, memiliki daya ingat yang kuat"
     Me.Text2.FontSize = 15
     Me.Text2.FontBold = True
     img8 = "leo-03.gif"
     Me.Image1.Picture = LoadPicture("D:\ARIN\VB\zodiak\" + img8)
ElseIf (Me.Combo2.Text = "Agustus" And Me.Combo1.Text >= 24) Or (Me.Combo2.Text = "September" And Me.Combo1.Text <= 22) Then
     c = "VIRGO"
     Me.Text3.Text = "24 Agustus-22 September"
     Me.Text2.Text = "Karakter:, analistis, praktis kritis, rajin, berkepala dingin dan logis, sederhana"
     Me.Text2.FontSize = 15
     Me.Text2.FontBold = True
     img9 = "virgo-03.gif"
     Me.Image1.Picture = LoadPicture("D:\ARIN\VB\zodiak\" + img9)
ElseIf (Me.Combo2.Text = "September" And Me.Combo1.Text >= 23) Or (Me.Combo2.Text = "Oktober" And Me.Combo1.Text <= 23) Then
     c = "LIBRA"
     Me.Text3.Text = "23 September-23 Oktober"
     Me.Text2.Text = "Karakter: memiliki naluri yang kuat, bimbang, penuh keraguan, adil pandai bermuka dua, mempesona"
     Me.Text2.FontSize = 15
     Me.Text2.FontBold = True
     img10 = "libra-03.gif"
     Me.Image1.Picture = LoadPicture("D:\ARIN\VB\zodiak\" + img10)
ElseIf Me.Combo2.Text = "Oktober" And Me.Combo1.Text >= 24 Or Me.Combo2.Text = "November" And Me.Combo1.Text <= 22 Then
     c = "SCORPIO"
     Me.Text3.Text = "24 Oktober-22 November"
     Me.Text2.Text = "Karakter: gigih, panjang akal, pendendam, tekun , pendiam."
     Me.Text2.FontSize = 15
     Me.Text2.FontBold = True
     img11 = "scorpio-03.gif"
     Me.Image1.Picture = LoadPicture("D:\ARIN\VB\zodiak\" + img11)
ElseIf Me.Combo2.Text = "November" And Me.Combo1.Text >= 23 Or Me.Combo2.Text = "Desember" And Me.Combo1.Text <= 21 Then
     c = "SAGITARIUS"
     Me.Text3.Text = "23 November-21 Desember"
     Me.Text2.Text = "Karakter: pandai berdiplomasi, berpandangan luas pandai, berjiwa petualang, mandiri, suka kebebasan."
     Me.Text2.FontSize = 15
     Me.Text2.FontBold = True
     img12 = "sagitarius-03.gif"
     Me.Image1.Picture = LoadPicture("D:\ARIN\VB\zodiak\" + img12)
End If
Text1 = c


End Sub
Private Sub Form_Load()
Dim d As Integer
Me.Combo3.Clear
For d = 1970 To 2017
    Me.Combo3.AddItem (d)
Next d

Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
If Image1.Visible = True Then
    Image1.Visible = False
ElseIf Image1.Visible = False Then
    Image1.Visible = True
End If
End Sub


*nb listing gambar zodiaknya muncul hanya pada pc/laptop ini, karena settingan pathnya ada dilaptop saya, jadi kalau ingin memunculkan gambarnya settingan pathnya tinggal diubah saja :)




output programnya seperti ini


3 komentar: