- Open the program vb6.0
- Then create a new project just by clicking File, New Project, Select Standard, then OK
- Prepare a TextBox and 3 command button, then delete the text in the TextBox and change the name of a command button in accordance with the wishes in the Properties window
Then type the following script in a command button
Private Sub CmdNamaBulan_Click()
Dim sBulan As String
Select Case Val(Text1.Text)
Case 1
sBulan = "Januari"
Case 2
sBulan = "Februari"
Case 3
sBulan = "Maret"
Case 4
sBulan = "April"
Case 5
sBulan = "Mei"
Case 6
sBulan = "Juni"
Case 7
sBulan = "Juli"
Case 8
sBulan = "Agustus"
Case 9
sBulan = "September"
Case 10
sBulan = "Oktober"
Case 11
sBulan = "November"
Case 12
sBulan = "Desember"
End Select
MsgBox "Bulan " & sBulan, vbOKOnly, "Bulan"
End Sub
Private Sub CmdClear_Click()
Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub CmdExit_Click()
Unload Me
End Sub
- Then run the program by way of the Run> Start or press F5
0 comments:
Post a Comment