Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
k_barang.Items.Add("SNY-TV-021")
k_barang.Items.Add("SMS-TV-032")
k_barang.Items.Add("TSH-TV-040")
k_barang.Items.Add("SHR-TV-024")
k_barang.Items.Add("PLY-TV-029")
Private Sub k_barang_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles k_barang.SelectedIndexChanged
Dim x As String
x = Microsoft.VisualBasic.Left(k_barang.Text, 3)
If x = "SNY" Then
n_barang.Text = "SONNY"
harga.Text = "2000000"
ElseIf x = "SMS" Then
n_barang.Text = "SAMSUNG"
harga.Text = "3850000"
ElseIf x = "TSH" Then
n_barang.Text = "TOSHIBA"
harga.Text = "4750000"
ElseIf x = "SHR" Then
n_barang.Text = "SHARP"
harga.Text = "2650000"
ElseIf x = "PLY" Then
n_barang.Text = "POLYTRON"
harga.Text = "2990000"
End If
Private Sub jlh_beli_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles jlh_beli.KeyPress
If Asc(e.KeyChar) = 13 Then
t_harga.Text = harga.Text * jlh_jual.Text
Bayar.Text = t_harga.Text - discount
End If
If t_harga.Text>2500000 than
discount.Text=0.1*t_harga
Else
discount.Text=""
Tidak ada komentar:
Posting Komentar