Form Design :
Private Sub kdbarang_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kdbarang.SelectedIndexChanged
Dim x As String
x = Microsoft.VisualBasic.Left(kdbarang.Text, 2)
Select Case x
Case "TS" : mrkbarang.Text = "Toshiba"
Case "VG" : mrkbarang.Text = "VGen"
End Select
Dim y As Integer
y = Microsoft.VisualBasic.Right(kdbarang.Text, 1)
Select Case y
Case Is = "001" : nmbarang.Text = "Flashdisk 4 Giga"
Case Is = "002" : nmbarang.Text = "Flashdisk 2 Giga"
End Select
If kdbarang.Text = "TS001" Then
harga.Text = "75000"
ElseIf kdbarang.Text = "TS002" Then
harga.Text = "60000"
ElseIf kdbarang.Text = "VG001" Then
harga.Text = "80000"
ElseIf kdbarang.Text = "VG002" Then
harga.Text = "65000"
End If
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
kdbarang.Items.Add("TS001")
kdbarang.Items.Add("TS002")
kdbarang.Items.Add("VG001")
kdbarang.Items.Add("VG002")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
total.Text = harga.Text * jlhbeli.Text
End Sub
Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
nmbarang.Text = ""
mrkbarang.Text = ""
harga.Text = ""
jlhbeli.Text = ""
total.Text = ""
kdbarang.Text = ""
End Sub
Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
End
End Sub
Tidak ada komentar:
Posting Komentar