Membuat Data Barang Meggunakan VB,net

Sunday 8 December 20130 comments


hai teman2 hari neh saya akan memostingkan cara membuat data barang penjualan TV sony dengan menggunakan VB net..

buat form seperti di gambar yah teman2




kemudian ketikkan perintah di bawah ini

1. Duble klik di Form 1..

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Nama.Items.Add("Sony 20 inchi")
        Nama.Items.Add("Sony 32 inchi")
        Nama.Items.Add("Sony 18 inchi")

        Dim i As Integer
        For i = 1 To 20
            JJ.Items.Add(i)
        Next

    End Sub
 2. duble klik di button keluar..

    Private Sub BtnKeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnKeluar.Click
        End

    End Sub

 3. Duble klik di  button Hapus....

    Private Sub Btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnhapus.Click
        Nama.Text = ""
        Harga.Text = ""
        JJ.Text = ""
        Discount.Text = ""
        Total.Text = ""
        TP.Text = ""

    End Sub
 4.Double klik di text box Nama...

    Private Sub Nama_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Nama.SelectedIndexChanged
        Select Case Nama.Text
            Case "Sony 20 inchi"
                Harga.Text = 2000000
            Case "Sony 32 inchi"
                Harga.Text = 5000000
            Case "Sony 18 inchi"
                Harga.Text = 1500000
        End Select
    End Sub
 5. Double klik di Button Proses...


    Private Sub Btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnproses.Click
        Total.Text = Harga.Text * JJ.Text

        If Total.Text > 2500000 Then
            Discount.Text = 0.01 * Total.Text
        Else
            Discount.Text = 0

        End If
        TP.Text = Total.Text - Discount.Text
    End Sub
End Class

ini hasil nya teman2


semoga bermanfaat yah teman2 :)
Share this article :

Post a Comment

 
Support : Hafiz_Blogger | haffiz Template | Mas Hafiz
Copyright © 2011. AhmaD_Haffiz - All Rights Reserved
Template Created by Creating hafiz_website Published by Mas Hafiz
Proudly powered by Blogger