Private Sub cmdClear_Click()
Txtnama.Text = ""
TxtAlamat.Text = ""
Optlaki.Value = False
Optperempuan.Value = False
LblHasil.Caption = ""
LstHobby.Text = ""
cmbpen.Text = ""
Cmbpek.Text = ""
End Sub
Private Sub cmdexit_Click()
End
End Sub
Private Sub Form_Activate()
Txtnama.SetFocus
End Sub
Private Sub Timer1_Timer()
LblJam.Caption = Time
LblTgl.Caption = Date
End Sub
Private Sub cmdcetak_Click()
Dim jenis, a As String
'hobi = lstHobby.Text
If Optlaki.Value = True Then
jenis =
"Laki-Laki"
Else
jenis =
"Perempuan"
End If
'UNTUK JENIS KELAMIN iif
(optlaki.value=true),optlaki.caption, optperempuan.caption) '
LblHasil.Caption = "Nama Saya " & Txtnama.Text
& " Seorang " & jenis & _
", Berpendidikan " & cmbpen.Text & "
Saya Tinggal di " & TxtAlamat.Text & _
" Pekerjaan Sekarang " & Cmbpek.Text &
" Hobbyku Adalah "
For i = 0 To LstHobby.ListCount - 1
If
LstHobby.Selected(i) Then
a = LstHobby.List(i)
LblHasil.Caption =
LblHasil.Caption & ", " & a
End If
Next i
End Sub
Private Sub cmdTambah1_Click()
masukan = InputBox("Tambahkan Jenis Pendidikan yang
Baru", "Tambah Pendidikan")
cmbpen.AddItem masuk
End Sub
Private Sub cmdTambah2_Click()
masuk = InputBox("Masukan Data Pekerjaan",
"Add")
Cmbpek.AddItem masuk
End Sub
Private Sub cmdTambah3_Click()
mask = InputBox("Masukan Data Hobby", "Add
Hobby")
LstHobby.AddItem masuk
End Sub
Private Sub Form_Load()
LstHobby.AddItem ("sepak bola")
LstHobby.AddItem ("Berenang")
LstHobby.AddItem ("Jalan-jalan")
LstHobby.AddItem ("mancing")
LstHobby.AddItem ("Tidur")
cmbpen.AddItem ("Sarjana")
cmbpen.AddItem ("SMA")
cmbpen.AddItem ("SMP")
cmbpen.AddItem ("play group")
Cmbpek.AddItem ("Pengusaha")
Cmbpek.AddItem ("Pelajar")
Cmbpek.AddItem ("polisi")
End Sub
Private Sub optLaki_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
CmdCetak.SetFocus
End If
End Sub
Private Sub txtAlamat_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Optlaki.SetFocus
End If
End Sub
Private Sub txtNama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtAlamat.SetFocus
End If
End Sub
Private Sub LblJam_Click()
LblJam.Caption = "11:27:24"
End Sub
Private Sub LblTgl_Click()
LblTgl.Caption = Format(Date, " dd mmmm yyyy ")
End Sub
Tidak ada komentar:
Posting Komentar