27 June 2012

Membuat Program Penjualan Barang


Skrip programnya sebagai berikut :

Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.Text = "  "
        TextBox2.Text = "  "
        TextBox3.Text = "  "
        TextBox4.Text = "  "
        TextBox5.Text = "  "
        TextBox6.Text = "  "
        TextBox7.Text = "  "
        TextBox8.Text = "  "
        ComboBox1.Items.Add(" Buku Tulis ")
        ComboBox1.Items.Add(" Pencil ")
        ComboBox1.Items.Add(" Majalah ")
        ComboBox1.Items.Add(" Ballpoint ")
        ComboBox1.Items.Add(" Buku Gambar ")
        ComboBox1.Items.Add(" Penghapus ")
        ListBox1.Items.Add(3400)
        ListBox1.Items.Add(2500)
        ListBox1.Items.Add(5000)
        ListBox1.Items.Add(3000)
        ListBox1.Items.Add(4500)
        ListBox1.Items.Add(800)
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = "  "
        TextBox2.Text = "  "
        TextBox3.Text = "  "
        TextBox4.Text = "  "
        TextBox5.Text = "  "
        TextBox6.Text = "  "
        TextBox7.Text = "  "
        TextBox8.Text = "  "
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim nama As String
        Dim alamat As String
        Dim barang As String
        Dim harga As Integer
        Dim jbeli As Integer
        Dim total As Double
        Dim discount As Double
        Dim jmlbayar As Double
        Dim jmluang As Double
        Dim kembali As Double
        nama = TextBox1.Text
        alamat = TextBox2.Text
        jbeli = Val(TextBox3.Text)
        jmluang = Val(TextBox7.Text)
        barang = ComboBox1.Text
        harga = ListBox1.SelectedItem
        total = harga * jbeli
        discount = total * 0.05
        jmlbayar = total - discount
        kembali = jmluang - jmlbayar
        TextBox4.Text = total
        TextBox8.Text = kembali
        TextBox5.Text = discount
        TextBox6.Text = jmlbayar
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Me.Close()
    End Sub
End Class

Semoga bermanfaat dan selamat mencoba.
jangan lupa komentar ya..hehe

sumber : materi kuliah

0 komentar:

Post a Comment

Terima kasih sudah memberi komentar,
komentar anda sangat berguna untuk menjadikan blog ane lebih baik lagi..
jangan lupa berkunjung kembali..