Desain awal
Public Class Form1
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
id.Items.Add("1761")
id.Items.Add("1762")
id.Items.Add("1763")
id.Items.Add("1764")
id.Items.Add("1765")
gol.Items.Add("IIIA")
gol.Items.Add("IIIB")
gol.Items.Add("IIIC")
End Sub
Private Sub id_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
id.SelectedIndexChanged
Select Case id.Text
Case
"1761"
nama.Text = "Rina Purnama"
Case
"1762"
nama.Text = "Chandra Pancari"
Case
"1763"
nama.Text = "Britney Spears"
Case
"1764"
nama.Text = "Selena Gomez"
Case
"1765"
nama.Text = "Kristen Stewart"
End Select
End Sub
Private Sub gol_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
gol.SelectedIndexChanged
Select Case gol.Text
Case
"IIIA"
gaji.Text = "1500000"
Case
"IIIB"
gaji.Text = "2500000"
Case
"IIIC"
gaji.Text = "3500000"
End Select
End Sub
Private Sub proses_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles proses.Click
pajak.Text = 0.15 * gaji.Text
gaber.Text = Val(gaji.Text) -
Val(pinjaman.Text) - Val(pajak.Text)
End Sub
Private Sub btnKeluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles btnKeluar.Click
Dim
tanya As String
tanya = MsgBox("Apakah
Anda ingin Keluar?", MsgBoxStyle.YesNo)
If
tanya = vbCancel Then
Me.Close()
ElseIf
tanya = vbNo Then
Me.Focus()
ElseIf
tanya = vbYes Then
Me.Close()
End If
End Sub
Private Sub hapus_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles hapus.Click
id.Text = ""
nama.Text = ""
gol.Text = ""
gaji.Text = ""
pinjaman.Text = ""
pajak.Text = ""
gaber.Text = ""
End Sub
End Class
Desain Akhir