Pages

Minggu, 13 Februari 2011

Tugas VB (membuat Calender)


Langkah 1
-          Membuat  4 label
-          Mengganti caption
-          Mengganti font dan alignment

Langkah 2
-          Membuat 1 list box
-          Mengganti font
-          Menambahkan list

Langkah 3
-          Membuat 2 text box
-          Mengganti caption
-          Menghapus text
Langkah 4
-          Membuat 12 image
-          Mengganti stretch menjadi true
-          Menambah picture


          CODING


Private Sub Form_Load()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
End Sub

Private Sub List1_Click()


If List1.ListIndex = 0 Then
Text1.Text = "muharram"
Text2.Text = "januari"
Image1.Visible = True
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
ElseIf List1.ListIndex = 1 Then Text1.Text = "safar"
Text2.Text = "Februari"
Image1.Visible = False
Image2.Visible = True
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
ElseIf List1.ListIndex = 2 Then Text1.Text = "Rabiul Awal"
Text2.Text = "Maret"
Image1.Visible = False
Image2.Visible = False
Image3.Visible = True
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
ElseIf List1.ListIndex = 3 Then Text1.Text = "Rabiul Akhir"
Text2.Text = "April"
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = True
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
ElseIf List1.ListIndex = 4 Then Text1.Text = "Jumadil Awal"
Text2.Text = "Mei"
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = True
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
ElseIf List1.ListIndex = 5 Then Text1.Text = "Jumadil Akhir"
Text2.Text = "Juni"
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = True
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
ElseIf List1.ListIndex = 6 Then Text1.Text = "Rajab"
Text2.Text = "Juli"
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = True
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
ElseIf List1.ListIndex = 7 Then Text1.Text = "Sya'ban"
Text2.Text = "Agustus"
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = True
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
ElseIf List1.ListIndex = 8 Then Text1.Text = "Ramadhan"
Text2.Text = "September"
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = True
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
ElseIf List1.ListIndex = 9 Then Text1.Text = "Syawal"
Text2.Text = "Oktober"
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = True
Image11.Visible = False
Image12.Visible = False
ElseIf List1.ListIndex = 10 Then Text1.Text = "Dzulkaidah"
Text2.Text = "November"
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = True
Image12.Visible = False
ElseIf List1.ListIndex = 11 Then Text1.Text = "Dzulhijjah"
Text2.Text = "Desember"
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = True
End If
End Sub



0 komentar:

Posting Komentar