Get me outta here!

Selasa, 03 Januari 2017

Contoh pembuatan data pegawai menggunakan aplikasi VB.NET

Kali ini saya akan membuat aplikasi pegawai menggukan aplikasi VB.NNET, Berikut langkah-langkahnya

1.  Buka aplikasi VB.NET

2. Buat desain seperti dibawah ini



3. Jika sudah maka masukkan kodingan seperti dibawah ini:

Public Class pegawai

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Close()
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        If ComboBox1.Text = "HNR" Then TextBox3.Text = "HONOR"
        If ComboBox1.Text = "STF" Then TextBox3.Text = "STAFF"
        If ComboBox1.Text = "KBG" Then TextBox3.Text = "KABAG"
        If ComboBox1.Text = "MGR" Then TextBox3.Text = "MANAGER"
        If ComboBox1.Text = "DIR" Then TextBox3.Text = "DIREKTUR"
        If ComboBox1.Text = "HNR" Then TextBox4.Text = "3000000"
        If ComboBox1.Text = "STF" Then TextBox4.Text = "3500000"
        If ComboBox1.Text = "KBG" Then TextBox4.Text = "5000000"
        If ComboBox1.Text = "MGR" Then TextBox4.Text = "7500000"
        If ComboBox1.Text = "DIR" Then TextBox4.Text = "10000000"
    End Sub

    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        If RadioButton1.Checked Then
            TextBox9.Text = "150000"
        End If
    End Sub

    Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
        If RadioButton2.Checked Then
            TextBox9.Text = "0"
        End If
    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.Checked Then TextBox8.Text = "SMA"
        If CheckBox1.Checked = False Then TextBox8.Text = ""
    End Sub

    Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
        If CheckBox2.Checked Then TextBox8.Text = "DIPLOMA"
        If CheckBox2.Checked = False Then TextBox8.Text = ""
    End Sub

    Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged
        If CheckBox3.Checked Then TextBox8.Text = "SARJANA"
        If CheckBox3.Checked = False Then TextBox8.Text = ""
    End Sub

    Private Sub CheckBox4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox4.CheckedChanged
        If CheckBox4.Checked Then TextBox8.Text = "MAGISTER"
        If CheckBox4.Checked = False Then TextBox8.Text = ""
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
        TextBox6.Text = ""
        TextBox7.Text = ""
        TextBox8.Text = ""
        TextBox9.Text = ""
        TextBox10.Text = ""
        ComboBox1.Text = ""
        ComboBox2.Text = ""
        RadioButton1.Checked = False
        RadioButton2.Checked = False
        CheckBox1.Checked = False
        CheckBox2.Checked = False
        CheckBox3.Checked = False
        CheckBox4.Checked = False
    End Sub
    Private Sub ComboBox2_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
        If ComboBox2.Text >= 3 Then
            TextBox10.Text = 3 * 150000
        Else
            TextBox10.Text = ComboBox2.Text * 50000
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim gkotor As Integer
        Dim gapok As Integer
        Dim status As Integer
        Dim anak As Integer
        Dim pajak As Integer
        Dim gditerima As Integer
        gapok = TextBox4.Text
        status = TextBox9.Text
        anak = TextBox10.Text
        gkotor = gapok + status + anak
        TextBox5.Text = gkotor
        pajak = 0.1 * gkotor
        TextBox6.Text = pajak
        gditerima = gkotor - pajak
        TextBox7.Text = gditerima
    End Sub
End Class

4. Jika sudah maka run program







Sekian pembahasan saya kali ini semoga bermanfaat bagi pembaca sekalia. terimakasi^^

0 komentar:

Posting Komentar