Search

Senin, 13 Oktober 2014

Pemrograman visual 01

 Pemrograman VB 6.0







Selamat Datang di Akas Midi

Private Sub cmdbeli_Click()
Combo1.Text = "Pilih Kode Barang"
txtjumbel.Text = ""
txttotal.Text = ""
txtubayar.Text = ""
txtukembali.Text = ""
txtmerk.Text = ""
txtharga.Text = ""
txtstok.Text = ""


End Sub

Private Sub cmdhitung_Click()
txttotal.Text = Val(txtjumbel.Text) * Val(txtharga.Text)

End Sub

Private Sub Combo1_Click()
If Combo1.Text = "C01" Then
txtmerk.Text = "Pepsodent"
txtharga.Text = "6000"
txtstok.Text = "100"
txtjumbel.SetFocus

ElseIf Combo1.Text = "C02" Then
txtmerk.Text = "Close Up"
txtharga.Text = "5000"
txtstok.Text = "200"
txtjumbel.SetFocus

Else
txtmerk.Text = "Enzim"
txtharga.Text = "8000"
txtstok.Text = "400"
txtjumbel.SetFocus

End If
End Sub

Private Sub Form_Load()
txtmerk.Enabled = False
txtstok.Enabled = False
txtharga.Enabled = False
txttotal.Enabled = False
txtukembali.Enabled = False

End Sub

Private Sub Timer1_Timer()
Text1 = Format(Date, "dd/mm/yyyy")
Text2 = Format(Time, "h:m:s")

End Sub

Private Sub txtjumbel_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotal.Text = Val(txtjumbel.Text) * Val(txtharga.Text)
txtubayar.SetFocus

End If

End Sub

Private Sub txtubayar_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtukembali.Text = Val(txtubayar.Text) - Val(txttotal.Text)

End If

End Sub