1.Pertama kita buat 2 labelbox
2.kemudian kita tambahkan combo box
3. kita tambahkan textbox
4. tambahkan 3 command buttonn dan ganti nama nama toolbox seperti di atas.
5. langkah terakhir kita yaitu mulai coding seperti di atas atau di bawah ini:
If Combo1.Text = "januari" Then
Text1.Text = "muharram dan shafar"
ElseIf Combo1.Text = "februari" Then
Text1.Text = "shafar dan rabiul al-awwal"
ElseIf Combo1.Text = "maret" Then
Text1.Text = "rabiul al-awal dan rabiul al-akhir"
ElseIf Combo1.Text = "april" Then
Text1.Text = "rabiul al-akhir dan jumadil al-awwal"
ElseIf Combo1.Text = "mei" Then
Text1.Text = "jumadil al-awwal dan jumadil al-akhir"
ElseIf Combo1.Text = "juni" Then
Text1.Text = "jumadil al-akhir dan rajab"
ElseIf Combo1.Text = "juli" Then
Text1.Text = "rajab dan sya'ban"
ElseIf Combo1.Text = "agustus" Then
Text1.Text = "ramadhan dan syawwal"
ElseIf Combo1.Text = "september" Then
Text1.Text = "syawwal dan dzul-qaidah"
ElseIf Combo1.Text = "oktober" Then
Text1.Text = "dzul-qaidah dan dzul-hijjah"
ElseIf Combo1.Text = "november" Then
Text1.Text = "dzul-hijjah dan muharram"
ElseIf Combo1.Text = "desember" Then
Text1.Text = "muharram dan shafar"
End If
End Sub
Private Sub Command1_Click()
If Combo1.Text = "januari" Then
Text1.Text = "muharram dan shafar"
ElseIf Combo1.Text = "februari" Then
Text1.Text = "shafar dan rabiul al-awwal"
ElseIf Combo1.Text = "maret" Then
Text1.Text = "rabiul al-awal dan rabiul al-akhir"
ElseIf Combo1.Text = "april" Then
Text1.Text = "rabiul al-akhir dan jumadil al-awwal"
ElseIf Combo1.Text = "mei" Then
Text1.Text = "jumadil al-awwal dan jumadil al-akhir"
ElseIf Combo1.Text = "juni" Then
Text1.Text = "jumadil al-akhir dan rajab"
ElseIf Combo1.Text = "juli" Then
Text1.Text = "rajab dan sya'ban"
ElseIf Combo1.Text = "agustus" Then
Text1.Text = "ramadhan dan syawwal"
ElseIf Combo1.Text = "september" Then
Text1.Text = "syawwal dan dzul-qaidah"
ElseIf Combo1.Text = "oktober" Then
Text1.Text = "dzul-qaidah dan dzul-hijjah"
ElseIf Combo1.Text = "november" Then
Text1.Text = "dzul-hijjah dan muharram"
ElseIf Combo1.Text = "desember" Then
Text1.Text = "muharram dan shafar"
End If
End Sub
Private Sub Command2_Click()
Combo1.Text = ""
Text1.Text = ""
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
MsgBox "selamat datang"
Combo1.AddItem "januari"
Combo1.AddItem "februari"
Combo1.AddItem "maret"
Combo1.AddItem "april"
Combo1.AddItem "mei"
Combo1.AddItem "juni"
Combo1.AddItem "juli"
Combo1.AddItem "agustus"
Combo1.AddItem "september"
Combo1.AddItem "oktober"
Combo1.AddItem "november"
Combo1.AddItem "desember"
End Sub
selamat bekerja
0 komentar:
Posting Komentar