Jumat, 18 Oktober 2013

Latihan Sederhana







Input Coding ny dibawah !!!

Private Sub Cmdinput_Click()Tharga.Text = "0"
Tlama.Text = "0"
Ttotal.Text = "0"
Tubay.Text = "0"
Option1 = False
Option2 = False
End Sub

Private Sub CmdKeluar_Click()
s = MsgBox("Yakin mau keluar ?", vbQuestion + vbYesNo)
If s = vbYes Then
Unload Me
End If
End Sub

Private Sub Form_Load()
Combo1.AddItem ("Single")
Combo1.AddItem ("Family")
End Sub

Private Sub Option1_Click()
If Combo1.Text = "Single" Then
Tharga.Text = 175000
Else
Tharga.Text = 300000
End If
End Sub

Private Sub Option2_Click()
If Combo1.Text = "Family" Then
Tharga.Text = 350000
Else
Tharga.Text = 200000
End If
End Sub


Private Sub Tlama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Ttotal.Text = Val(Tlama.Text) * Val(Tharga.Text)
End If
End Sub


Private Sub Tubay_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Tubay.Text = Val(Tubay.Text) - Val(Ttotal.Text)
p = MsgBox("Uang Kembali = Rp. " + Tubay, vbInformation + vbOKOnly, "Promotel")
End If
End Sub

Tidak ada komentar:

Posting Komentar