CONTOH PROGRAM IF JAMAK
PrivateSub
btnhapus_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
btnhapus.Click
tipe.Text = ""
seri.Text = ""
harga.Text = ""
jumlah.Text = ""
total.Text = ""
kondisi.Text = ""
EndSub
PrivateSub
Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
tipe.Items.Add("NOKIA")
tipe.Items.Add("SAMSUNG")
tipe.Items.Add("SIE
MEN")
tipe.Items.Add("MOTOROLLA")
kondisi.Items.Add("BARU")
kondisi.Items.Add("SECOND")
EndSub
PrivateSub
tipe_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
tipe.SelectedIndexChanged
seri.Items.Clear()
If tipe.Text
= "NOKIA"Then
seri.Items.Add("N70")
seri.Items.Add("N73")
ElseIf tipe.Text
= "SAMSUNG"Then
seri.Items.Add("SII")
seri.Items.Add("GYOUNG")
ElseIf tipe.Text
= "SIE MEN"Then
seri.Items.Add("C55")
seri.Items.Add("M55")
ElseIf tipe.Text
= "MOTOROLA"Then
seri.Items.Add("MX31")
seri.Items.Add("XM31")
EndIf
EndSub
PrivateSub
kondisi_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
kondisi.SelectedIndexChanged
harga.Text = 0
If seri.Text
= "N70"And
kondisi.Text = "BARU"Then
harga.Text = 3000000
ElseIf seri.Text
= "N70"And
kondisi.Text = "SECOND"Then
harga.Text = 2500000
ElseIf seri.Text
= "N73"And
kondisi.Text = "BARU"Then
harga.Text = 2400000
ElseIf seri.Text
= "N73"And
kondisi.Text = "SECOND"Then
harga.Text = 1400000
ElseIf seri.Text
= "SII"And
kondisi.Text = "BARU"Then
harga.Text = 2600000
ElseIf seri.Text
= "SII"And
kondisi.Text = "SECOND"Then
harga.Text = 1300000
ElseIf seri.Text
= "GYOUNG"And
kondisi.Text = "BARU"Then
harga.Text = 2500000
ElseIf seri.Text
= "GYOUNG"And
kondisi.Text = "SECOND"Then
harga.Text = 1200000
ElseIf seri.Text
= "C55"And
kondisi.Text = "BARU"Then
harga.Text = 2300000
ElseIf seri.Text
= "C55"And
kondisi.Text = "SECOND"Then
harga.Text = 1000000
ElseIf seri.Text
= "M55"And
kondisi.Text = "BARU"Then
harga.Text = 2000000
ElseIf seri.Text
= "M55"And
kondisi.Text = "SECOND"Then
harga.Text = 1100000
ElseIf seri.Text
= "MX31"And
kondisi.Text = "BARU"Then
harga.Text = 1900000
ElseIf seri.Text
= "MX31"And
kondisi.Text = "SECOND"Then
harga.Text = 800000
ElseIf seri.Text
= "SII"And
kondisi.Text = "BARU"Then
harga.Text = 1500000
ElseIf seri.Text
= "SII"And
kondisi.Text = "SECOND"Then
harga.Text = 700000
EndIf
EndSub
PrivateSub
btnkeluar_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
btnkeluar.Click
End
EndSub
PrivateSub
jumlah_KeyPress(ByVal sender AsObject, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles jumlah.KeyPress
If e.KeyChar
= Chr(13) Then
total.Text = harga.Text *
jumlah.Text
EndIf
EndSub
PrivateSub
jumlah_TextChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
jumlah.TextChanged
EndSub
EndClass
Tidak ada komentar:
Posting Komentar