sekarang saya akan share kepada teman-teman cara membuat form pembayaran di visual studio 2008
sebelum mengetikkan kode dibawah tulis dulu nama textbox nya agar sama dengan kode dibawah
kode pelanggan= kp
nama pelanggan= np
tipe= tip
biaya beban= bb
jumlah pemakaian= jp
total tagihan= tt
pembayaran= pem
daerah= dae
harga m3= hm
pajak= paj
Public Class Form1
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
End
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-BEL-102")
kp.Items.Add("RUM-MED-103")
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)
If x = "100" Then
np.Text = "munawar khalil"
ElseIf x = "101" Then
np.Text = "buyung alamsyah"
ElseIf x = "102" Then
np.Text = "rinaldi jambak"
ElseIf x = "103" Then
np.Text = "syawal"
End If
x = Microsoft.VisualBasic.Left(kp.Text, 3)
If x = "PAB" Then
tip.Text = "pabrik"
bb.Text = 25000
hm.Text = 500
ElseIf x = "TOK" Then
tip.Text = "toko"
bb.Text = 25000
hm.Text = 300
ElseIf x = "SWA" Then
tip.Text = "swalayan"
bb.Text = 15000
hm.Text = 200
ElseIf x = "RUM" Then
tip.Text = "rumah"
bb.Text = 10000
hm.Text = 100
End If
x = Microsoft.VisualBasic.Mid(kp.Text, 5, 3)
If x = "MED" Then
dae.Text = "medan"
ElseIf x = "BEL" Then
dae.Text = "belawan"
End If
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) + hm.Text * jp.Text
paj.Text = 0.01 * tt.Text
pem.Text = Val(paj.Text) + Val(jp.Text)
End If
End Sub
Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
kp.Text = ""
np.Text = ""
tip.Text = ""
bb.Text = ""
jp.Text = ""
tt.Text = ""
pem.Text = ""
dae.Text = ""
hm.Text = ""
paj.Text = ""
End Sub
End Class
Tidak ada komentar:
Posting Komentar