(Saya sudah mencoba berkali2 Pak, sebisa saya..tp programnya eror terus.)
Pertama buatlah form seperti dibawah ini,
Menghitung penjualan brg di Butik |
Buat Form terdiri dari 4 Label dan 4 text box,serta 3 button klik dari toolbox.
Label pertama memuat kode barang. label kedua Nama barang, ketiga harga, keempat jumlah,sedangkan cekbox berisi Total harga, diskon dan tutup
output |
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.) Handles MyBase.Load
cmbkode.Items.Add("Tas")
cmbkode.Items.Add("Bju")
cmbkode.Items.Add("SPT)
Form2.Show()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Private Sub cmbkode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles cmbkode.SelectedIndexChanged
Dim kdbrg, namabrg As String
Dim harga As Single
kdbrg = cmbkd.Text
Select Case kdbrg
Case " Tas"
namabarang = "Tas"
harga = 550000
Case " Bju"
namabarang = "baju"
harga = 350000
Case "Spt"
harga = 100000
Case Else
namabarang = "-"
harga = 0
End Select
txtnama.Text = namabarang
txtharga.Text = harga
End Sub
Private sub txtjumlah_textChanged(ByVal sender As System.Object, ByVal e
As system.Eventargs) Handles txtjumlah.TextChanged
txttotal.Text = Val(txtharga.Text) * Val(txtjumlah.Text)
txtbayar.Text = Val(txttotal.Text) - Val(txtdiskon.Text)
Tidak ada komentar:
Posting Komentar