Kali saya akan membuat sebuah program cara penghitungan penjualan handphone dengan menggunakan visual basic net..
Silahkan dilihat :
Bentuk Form
Berikut kode nya :
Public Class Form1
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Nama.Items.Add("BLACKBERRY
9300")
Nama.Items.Add("SONY
EXPERIA")
Nama.Items.Add("SAMSUNG
GALAXY S4")
Nama.Items.Add("BLACKBERRY
Q10")
Nama.Items.Add("BLACKBERRY
Z10")
Dim i As Integer
For i =
1 To 10
Jumlah.Items.Add(i)
Next
End Sub
Private Sub Nama_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
Nama.SelectedIndexChanged
Select Case Nama.Text
Case
"BLACKBERRY 9300"
Harga.Text = "2000000"
Case
"SONY EXPERIA"
Harga.Text = "4500000"
Case
"SAMSUNG GALAXY S4"
Harga.Text = "4000000"
Case
"BLACKBERRY Q10"
Harga.Text = "6500000"
Case
"BLACKBERRY Z10"
Harga.Text = "6000000"
End Select
End Sub
Private Sub Totalharga_KeyPress(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles
Totalharga.KeyPress
Totalharga.Text = Harga.Text *
Jumlah.Text
If
Totalharga.Text > 2500000 Then
Discount.Text = 0.1 *
Totalharga.Text
Else
Discount.Text = 0
End If
End Sub
Private Sub Button1_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Total.Text = Totalharga.Text -
Discount.Text
End Sub
End Class
Dan inilah hasilnya :
Hasil Form
gan button 1 nya gk bisa proses
ReplyDelete