Copy kode program dibawah ini lalu pastekan diarea kode VB STUDIO 2008 anda :
Public Class Form1
Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
kp.Text = ""
nama.Text = ""
tipe.Text = ""
harga.Text = ""
jp.Text = ""
tt.Text = ""
pembayaran.Text = ""
daerah.Text = ""
bb.Text = ""
pajak.Text = ""
End Sub
Private Sub kp_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kp.SelectedIndexChanged
Dim x As String
x = Microsoft.VisualBasic.Right(kp.Text, 3)
Select Case x
Case "100" : nama.Text = "ucok"
Case "101" : nama.Text = "Johan F"
Case "102" : nama.Text = "Erin"
End Select
x = Microsoft.VisualBasic.Left(kp.Text, 3)
Select Case x
Case "PAB"
harga.Text = 25000
bb.Text = 250000
tipe.Text = "PABRIK"
Case "TOK"
harga.Text = 250
bb.Text = 15000
tipe.Text = "TOKO"
Case "SWA"
harga.Text = 20000
bb.Text = 60000
tipe.Text = "SWALAYAN"
End Select
x = Microsoft.VisualBasic.Mid(kp.Text, 5, 3)
Select Case x
Case "MED" : daerah.Text = "Medan"
Case "BEL" : daerah.Text = "Belawan"
Case Else : daerah.Text = "_"
End Select
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
kp.Items.Add("PAB-MED-100")
kp.Items.Add("TOK-BEL-101")
kp.Items.Add("SWA-MED-102")
pembayaran.Enabled = False
pajak.Enabled = False
tt.Enabled = False
bb.Enabled = False
nama.Enabled = False
harga.Enabled = False
daerah.Enabled = False
tipe.Enabled = False
End Sub
Private Sub jp_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles jp.KeyPress
If Asc(e.KeyChar) = 13 Then
tt.Text = Val(bb.Text) + (harga.Text * jp.Text)
pajak.Text = 0.01 * tt.Text
pembayaran.Text = Val(tt.Text) + Val(pajak.Text)
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
0 comments:
Post a Comment
Isikan Komentar Yang Bermanfaat Untuk Membangun ya Gann....