CODING PROGRAM
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.Items.Add("PM010")
ComboBox1.Items.Add("PS111")
ComboBox1.Items.Add("GD100")
ComboBox1.Items.Add("PM011")
ComboBox2.Items.Add("Kepala Divisi")
ComboBox2.Items.Add("Staf")
ComboBox2.Items.Add("Wakil Kepala")
ComboBox3.Items.Add("Menikah")
ComboBox3.Items.Add("Belum Menikah")
ComboBox4.Items.Add("1")
ComboBox4.Items.Add("2")
TextBox5.Enabled = False
TextBox6.Enabled = False
TextBox7.Enabled = False
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim x = Microsoft.VisualBasic.Left(ComboBox1.Text, 2)
If ComboBox1.Text = "PM010" Then
If x = "PM" Then
TextBox1.Text = "Reza ariansyah"
TextBox2.Text = "Pemasaran"
End If
ElseIf ComboBox1.Text = "PS111" Then
If x = "PS" Then
TextBox1.Text = "lenni sundari"
TextBox2.Text = "Personal"
End If
ElseIf ComboBox1.Text = "KU101" Then
If x = "KU" Then
TextBox1.Text = "Jailam Igaph"
TextBox2.Text = "Keuangan"
End If
ElseIf ComboBox1.Text = "GD100" Then
If x = "GD" Then
TextBox1.Text = "Jailam Igaph"
TextBox2.Text = "Keuangan"
End If
Else
If x = "PM" Then
TextBox1.Text = "Agus Setiawan"
TextBox2.Text = "Gudang"
End If
End If
End Sub
Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
Select Case ComboBox2.Text
Case "Kepala Divisi"
TextBox3.Text = "5000000"
TextBox4.Text = 0.1 * TextBox3.Text
Case "Staf"
TextBox3.Text = "2000000"
TextBox4.Text = 0.1 * TextBox3.Text
Case "Wakil Kepala"
TextBox3.Text = "3500000"
TextBox4.Text = 0.1 * TextBox3.Text
End Select
End Sub
Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged
If ComboBox3.Text = "Menikah" Then
TextBox5.Text = 15 / 100 * TextBox3.Text
ComboBox4.Enabled = True
Else
TextBox5.Text = ""
ComboBox4.Enabled = False
TextBox6.Text = ""
ComboBox4.Text = ""
TextBox7.Text = Val(TextBox3.Text) + Val(TextBox5.Text) + Val(TextBox6.Text) - Val(TextBox4.Text)
End If
End Sub
Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged
If ComboBox4.Text = "1" Then
TextBox6.Text = 5 / 100 * TextBox3.Text
ElseIf ComboBox4.Text = "2" Then
TextBox6.Text = 10 / 100 * TextBox3.Text
Else
TextBox6.Text = 0
TextBox5.Text = ""
End If
TextBox7.Text = Val(TextBox3.Text) + Val(TextBox5.Text) + Val(TextBox6.Text) - Val(TextBox4.Text)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
ComboBox1.Text = ""
ComboBox2.Text = ""
ComboBox3.Text = ""
ComboBox4.Text = ""
ComboBox4.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class


Posting Komentar