Untuk Code Log in
Public Class Form2
Private Sub BtnLogin_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BtnLogin.Click
If
User.Text = "" Or Pass.Text = ""
Then
MsgBox("Data
Tidak Ada", MsgBoxStyle.Critical, Me)
ElseIf
User.Text = "Rizki" And Pass.Text = "77"
Then
Form3.Show()
ElseIf
User.Text <> "Rizki" Or Pass.Text <> "77"
Then
MsgBox("Log
in Salah", MsgBoxStyle.Critical)
End If
Teks.Visible = True
End Sub
Sub tk()
Teks.Text = "User
: Rizki" & vbCrLf & _
"Pass : 77 "
End Sub
Private Sub Form2_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
tk()
End Sub
Private Sub Button1_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Teks.Visible = True
End Sub
End Class
Untuk Code Menu
Public Class Form3
Private Sub DataPDAMToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
DataPDAMToolStripMenuItem.Click
Form1.Show()
End Sub
Private Sub Form3_FormClosing(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.FormClosingEventArgs) Handles
Me.FormClosing
e.Cancel = True
If
MsgBox("Anda Yakin Keluar?",
MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Me.Hide()
End If
End Sub
Private Sub Form3_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
End Class
Untuk Code Tagihan Pdam
Public Class Form1
Sub
kodeplg()
Dim A,
B, C As String
A =
Microsoft.VisualBasic.Left(Kode_p.Text, 3)
B =
Microsoft.VisualBasic.Mid(Kode_p.Text, 5, 3)
C =
Microsoft.VisualBasic.Right(Kode_p.Text, 3)
No_urut.Text = C
If A = "TOK" Then
Type_p.Text = "Toko"
Beban.Text = 25000
Harga_M3.Text = 300
ElseIf
A = "RUM" Then
Type_p.Text = "Rumah"
Beban.Text = 15000
Harga_M3.Text = 100
ElseIf
A = "SWA" Then
Type_p.Text = "Swalayan"
Beban.Text = 10000
Harga_M3.Text = 200
ElseIf
A = "PAB" Then
Type_p.Text = "Pabrik"
Beban.Text = 250000
Harga_M3.Text = 500
End If
If B = "MED" Then
Nama_D.Text = "Medan"
ElseIf
B = "BEL" Then
Nama_D.Text = "Belawan"
ElseIf
B = "TEM" Then
Nama_D.Text = "Aksara"
ElseIf
B = "MAR" Then
Nama_D.Text = "Marendal"
ElseIf
B = "BIN" Then
Nama_D.Text = "Binjay"
ElseIf
B = "PAK" Then
Nama_D.Text = "Lubuk Pakam"
End If
End Sub
Sub
kodeplgCOMBO()
Dim A,
B, C As String
A =
Microsoft.VisualBasic.Left(KDP.Text, 3)
B = Microsoft.VisualBasic.Mid(KDP.Text,
5, 3)
C =
Microsoft.VisualBasic.Right(KDP.Text, 3)
No_urut.Text = C
If A = "TOK" Then
Type_p.Text = "Toko"
Beban.Text = 25000
Harga_M3.Text = 300
ElseIf
A = "RUM" Then
Type_p.Text = "Rumah"
Beban.Text = 15000
Harga_M3.Text = 100
ElseIf
A = "SWA" Then
Type_p.Text = "Swalayan"
Beban.Text = 10000
Harga_M3.Text = 200
ElseIf
A = "PAB" Then
Type_p.Text = "Pabrik"
Beban.Text = 250000
Harga_M3.Text = 500
End If
If B = "MED" Then
Nama_D.Text = "Medan"
ElseIf
B = "BEL" Then
Nama_D.Text = "Belawan"
ElseIf
B = "TEM" Then
Nama_D.Text = "Aksara"
ElseIf
B = "MAR" Then
Nama_D.Text = "Marendal"
ElseIf
B = "BIN" Then
Nama_D.Text = "Binjay"
ElseIf
B = "PAK" Then
Nama_D.Text = "Lubuk Pakam"
End If
End Sub
Private Sub Kode_p_KeyPress(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles
Kode_p.KeyPress
If
Asc(e.KeyChar) = 13 Then
kodeplg()
End If
End Sub
Private Sub Rata_rata_KeyPress(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles
Rata_rata.KeyPress
If
Asc(e.KeyChar) = 13 Then
PerBulan.Text = Rata_rata.Text * 30
Total.Text = PerBulan.Text *
Harga_M3.Text + Val(Beban.Text)
Pajak.Text = 0.01 * Total.Text
Pembayaran.Text = Val(Total.Text) +
Val(Pajak.Text)
End If
End Sub
Sub
ISIKDP()
KDP.Items.Add("TOK-MED-001")
KDP.Items.Add("TOK-BEL-001")
KDP.Items.Add("TOK-TEM-001")
KDP.Items.Add("TOK-MAR-001")
KDP.Items.Add("TOK-BIN-001")
KDP.Items.Add("TOK-PAK-001")
KDP.Items.Add("RUM-MED-001")
KDP.Items.Add("RUM-BEL-001")
KDP.Items.Add("RUM-TEM-001")
KDP.Items.Add("RUM-MAR-001")
KDP.Items.Add("RUM-BIN-001")
KDP.Items.Add("RUM-PAK-001")
KDP.Items.Add("SWA-MED-001")
KDP.Items.Add("SWA-BEL-001")
KDP.Items.Add("SWA-TEM-001")
KDP.Items.Add("SWA-MAR-001")
KDP.Items.Add("SWA-BIN-001")
KDP.Items.Add("SWA-PAK-001")
KDP.Items.Add("PAB-MED-001")
KDP.Items.Add("PAB-BEL-001")
KDP.Items.Add("PAB-TEM-001")
KDP.Items.Add("PAB-MAR-001")
KDP.Items.Add("PAB-BIN-001")
KDP.Items.Add("PAB-PAK-001")
End Sub
Sub
keterangan()
Ket.Text = "Cara
Penginputan Dengan Text Box" & vbCrLf & _
" Type-Kota-No.Urut" &
vbCrLf & _
"Contoh
= PAB-PAK-001" & vbCrLf & _
"Type Kota" & vbCrLf & _
"--------------------------"
& vbCrLf & _
"PAB MED" & vbCrLf & _
"SWA BEL" & vbCrLf & _
"RUM TEM" & vbCrLf & _
"TOK MAR" & vbCrLf & _
" BIN" & vbCrLf
& _
" PAK" & vbCrLf
& vbCrLf & _
"NO
URUT HANYA BOLEH 3 ANGKA"
End Sub
Private Sub Form1_FormClosing(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.FormClosingEventArgs) Handles
Me.FormClosing
e.Cancel = True
If
MsgBox("Anda Yakin Keluar?",
MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Me.Hide()
End If
End Sub
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ISIKDP()
keterangan()
End Sub
Private Sub KDP_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
KDP.SelectedIndexChanged
kodeplgCOMBO()
End Sub
Private Sub Button1_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Kode_p.Visible = True
KDP.Visible = False
Cara.Visible = False
Ket.Visible = True
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
KDP.Visible = True
Kode_p.Visible = False
Cara.Visible = False
Ket.Visible = False
End Sub
Private Sub Rata_rata_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Rata_rata.TextChanged
If Not IsNumeric(Rata_rata.Text) Then
Rata_rata.Clear()
End If
End Sub
Private Sub Ket_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Ket.TextChanged
End Sub
Private Sub BtnHapus_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BtnHapus.Click
brsh(Me)
keterangan()
End Sub
Sub brsh(ByVal F As Form)
Dim x As Object
For Each x In F.Controls
If TypeOf x Is TextBox Then x.text = ""
If TypeOf x Is ComboBox Then x.text = ""
Next
End Sub
End Class
Menggunakan TEXBOX
Menggunakan COMBOBOX