Latihan vb Toko Digital LG

 design layout

  Hasil run
 
 
 
 
 
 
Private Sub cmdkeluar_Click()
If MsgBox("Apakah Anda yakin mau keluar ?", vbQuestion + vbYesNo, "information") = vbYes Then
End
End If
End Sub

Private Sub cmdbersih_Click()
cmbkode.Text = ""
txtnama.Text = ""
txtharga.Text = ""
txtjumbel.Text = ""
txtpajak.Text = ""
txttotal.Text = ""
txtbonus.Text = ""
cmbkode.SetFocus
End Sub

Private Sub txtjumbel_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
 txtpajak.Text = 0.01 * txtharga.Text * Val(txtjumbel.Text)
 txttotal.Text = txtharga.Text * Val(txtjumbel.Text) + txtpajak.Text
If Val(txttotal.Text) >= 1550000 Then
 txtbonus.Text = "JAM TANGAN"
Else
txtbonus.Text = "tidak dapat"
End If
End If
End Sub

Private Sub cmbkode_Click()
If cmbkode.ListIndex = 0 Then
 txtnama.Text = " MESIN CUCI"
 txtharga.Text = 2000000
ElseIf cmbkode.ListIndex = 1 Then
 txtnama.Text = "KULKAS"
 txtharga.Text = 1750000
ElseIf cmbkode.ListIndex = 2 Then
 txtnama.Text = "TELEVISI"
 txtharga.Text = 1500000
End If
 txtjumbel.SetFocus

End Sub

Private Sub Form_Load()
cmbkode.AddItem ("A001")
cmbkode.AddItem ("A002")
cmbkode.AddItem ("A003")
End Sub


Private Sub txtnama_Change()

End Sub
Best Regard,

0 comments:

Post a Comment

No Coment No Spam!!!

Image Hosted by ImageShack.us