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
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
Private Sub BtnKeluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BtnKeluar.Click
End
End Sub
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
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
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 :)
Post a Comment