buat form baru untuk tempat desainnya seperti dibawah ini
selanjutnya letakkan dan desain satu persatu label,textcombobox,dan buttonnya seperti dibawah ini
lalu berilah nama pada label ,texbox,combobox,dan button
sesuai dengan keinginan kita masing masing
selajnutnya isi listingnya seperti dibawah ini
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
nik.Items.Add("pm010")
nik.Items.Add("ps111")
nik.Items.Add("ku101")
nik.Items.Add("gd100")
nik.Items.Add("pm011")
jabatan.Items.Add("kepala divisi")
jabatan.Items.Add("staff")
jabatan.Items.Add("wakil")
status.Items.Add("Menikah")
status.Items.Add("Belum Menikah")
Dim L As Byte
For L = 0 To 15
jumnak.Items.Add(L)
Next
End Sub
Private Sub nik_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nik.SelectedIndexChanged
Select Case nik.Text
Case ("pm010")
nama.Text = "lukman"
Case ("ps111")
nama.Text = "suhairi"
Case ("ku101")
nama.Text = "robby"
Case ("gd100")
nama.Text = "dedi"
Case ("pm011")
nama.Text = "ruswin"
End Select
Dim x As String
x = Microsoft.VisualBasic.Left(nik.Text, 2)
If x = "pm" Then
bagian.Text = "pemasaran"
ElseIf x = "ps" Then
bagian.Text = "personalia"
ElseIf x = "ku" Then
bagian.Text = "keuangan"
ElseIf x = "gd" Then
bagian.Text = "gudang"
End If
End Sub
Private Sub jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jabatan.SelectedIndexChanged
Select Case jabatan.Text
Case ("kepala divisi")
gapok.Text = "5000000"
pajak.Text = 0.1 * gapok.Text
Case ("wakil")
gapok.Text = "3500000"
pajak.Text = 0.1 * gapok.Text
Case ("staff")
gapok.Text = "2000000"
pajak.Text = 0.1 * gapok.Text
End Select
End Sub
Private Sub status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles status.SelectedIndexChanged
If status.Text = "Menikah" Then
tunker.Text = 0.1 * gapok.Text
Else
tunker.Text = 0
End If
End Sub
Private Sub jumnak_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jumnak.SelectedIndexChanged
Select Case jumnak.Text
Case "1"
tunjan.Text = 0.05 * gapok.Text
Case "2"
tunjan.Text = 0.1 * gapok.Text
Case "3 to 15"
tunjan.Text = 0 * gapok.Text
End Select
End Sub
Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
nik.Text = ""
nama.Text = ""
tunjan.Text = ""
tunker.Text = ""
gapok.Text = ""
jumnak.Text = ""
status.Text = ""
toga.Text = ""
jabatan.Text = ""
pajak.Text = ""
bagian.Text = ""
End Sub
Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
End
End Sub
Private Sub btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click
toga.Text = Val(gapok.Text) + Val(tunker.Text) + Val(tunjan.Text) - Val(pajak.Text)
End Sub
End Class
coba jalankan program menggunakan "F5" tanpa tanda kutip , jika masih terdapat eror coba perbaiki eror tersebut
jika sudah berjalan maka tampilannya akan seperti dibawah ini
Demikianlah postingan saya kali ini,semoga bermanfaat buat kita semua
mohon kritik dan saran membangunyya ya........
lukmanwijaya4@gmail.com