Listing Programnya :
Public Class Form1
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Kode.Items.Add("TS001")
Kode.Items.Add("TS002")
Kode.Items.Add("VG001")
Kode.Items.Add("VG002")
End Sub
Private Sub Kode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
Kode.SelectedIndexChanged
Dim X As String
X =
Microsoft.VisualBasic.Left(Kode.Text, 2)
Select Case X
Case
"TS" : Merk.Text = "Toshiba"
Case
"TS" : Merk.Text = "Toshiba"
Case
"VG": Merk.Text = " V-GEN"
Case
"VG" : Merk.Text = "V-GEN"
End Select
X =
Microsoft.VisualBasic.Right(Kode.Text, 3)
Select X
Case
"001" : NamaBarang.Text = "Flashdisk 4GB"
Case
"002" : NamaBarang.Text = "Flashdisk 2GB"
Case
"001" : NamaBarang.Text = "Flashdisk 4GB"
Case
"002" : NamaBarang.Text = "Flashdisk 2GB"
End Select
End Sub
End Class
Berikut Hasilnya :
Tidak ada komentar