Yuk! Belajar Pemrograman Visual Basic dot Net Di Mesran.Net
Public Class
Form2
Private Sub Form2_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
kbrg.Items.Add("TS001")
kbrg.Items.Add("TS002")
kbrg.Items.Add("VG001")
kbrg.Items.Add("VG002")
End Sub
Private Sub kbrg_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
kbrg.SelectedIndexChanged
Dim x As String
Dim X2 As String
x =
Microsoft.VisualBasic.Left(kbrg.Text, 2)
Select Case x
Case
"TS" : merk.Text = "Toshiba"
Case
"VG" : merk.Text = "V-GEN"
End Select
X2 =
Microsoft.VisualBasic.Right(kbrg.Text, 3)
Select Case X2
Case
"001" : nbrg.Text = "Flasdisk 4GB"
Case
"002" : nbrg.Text = "Flasdisk 2GB"
End Select
If x = "TS" And
x2 = "001" Then
hrg.Text = 105000
ElseIf
x = "TS Public
Class Form2
" And X2 = "002" Then
hrg.Text = 75000
ElseIf
x = "VG" And
X2 = "001" Then
hrg.Text = 90000
Else
hrg.Text = 60000
End If
End Sub
Private Sub btnproses_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles btnproses.Click
total.Text = hrg.Text * jmlh.Text
End Sub
Private Sub btnhapus_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles btnhapus.Click
total.Text = ""
hrg.Text = ""
nopem.Text = ""
kbrg.Text = ""
merk.Text = ""
nbrg.Text = ""
jmlh.Text = ""
End Sub
Private Sub btnkeluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles btnkeluar.Click
Me.Close()
End Sub
End Class
Tidak ada komentar:
Posting Komentar