0% found this document useful (0 votes)
13 views

"Kerja Keras" "Password Anda Benar.... " "Menghitung Gaji": Form1 Object Eventargs Msgboxstyle Form2

The document contains code for two Windows forms (Form1 and Form2) written in Visual Basic. Form1 handles user input of employee data like name, job title, etc. If the password entered is correct, it opens Form2 and passes the input data. Form2 displays the employee's calculated salary based on job title, bonus percentage, and number of children. It allows clearing fields and returning to Form1. Buttons on each form trigger events to handle input, calculations, clearing fields and moving between forms.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

"Kerja Keras" "Password Anda Benar.... " "Menghitung Gaji": Form1 Object Eventargs Msgboxstyle Form2

The document contains code for two Windows forms (Form1 and Form2) written in Visual Basic. Form1 handles user input of employee data like name, job title, etc. If the password entered is correct, it opens Form2 and passes the input data. Form2 displays the employee's calculated salary based on job title, bonus percentage, and number of children. It allows clearing fields and returning to Form1. Buttons on each form trigger events to handle input, calculations, clearing fields and moving between forms.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button1.Click
If TextBox4.Text = "kerja keras" Then
MsgBox("password Anda Benar....", MsgBoxStyle.Information, Title:="Menghitung gaji")
Form2.Show()
Form2.Label2.Text() = Me.TextBox1.Text
Form2.Label3.Text = Me.TextBox2.Text
Form2.Label9.Text = Me.TextBox3.Text
Me.Hide()
Else : MsgBox("anda tidak boleh masuk!!!", MsgBoxStyle.Information, Title:="menghitung
gaji")
End If
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 = ""
TextBox1.Focus()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
Dim keluar As MsgBoxResult
keluar = MsgBox("ingin keluar???", MsgBoxStyle.Question + vbYesNo, Title:="kotak keluar")
If keluar = vbYes Then
End
Else
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox1.Focus()
End If
End Sub
End Class

Public Class Form2


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 = ""
TextBox7.Text = ""
TextBox1.Focus()
End Sub
Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Label5.Click
If Label9.Text = "direktur" Then
TextBox2.Text = 1500000
ElseIf Label9.Text = "manager" Then
TextBox2.Text = 1000000
ElseIf Label9.Text = "staff" Then
TextBox2.Text = 750000
ElseIf Label9.Text = "biasa" Then
TextBox2.Text = 500000
Else
MsgBox("Tidak ada jabatan!!!!", MsgBoxStyle.Information, Title:="gaji error")
End If
End Sub
Private Sub Label6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Label6.Click
If Label9.Text = "direktur" Then
TextBox3.Text = 7 / 100 * TextBox2.Text
ElseIf Label9.Text = "manager" Then
TextBox3.Text = 7 / 100 * TextBox2.Text
ElseIf Label9.Text = "staff" Then
TextBox3.Text = 0 / 100 * TextBox2.Text
ElseIf Label9.Text = "biasa" Then
TextBox3.Text = 0 / 100 * TextBox2.Text
Else
MsgBox("Tidak ada jabatan!!!!", MsgBoxStyle.Information, Title:="gaji error")
End If
End Sub
Private Sub Label8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Label8.Click
Dim c As Integer
c = Val(TextBox4.Text)
If c <= 2 Then
TextBox5.Text = c * 5 / 100 * TextBox2.Text
Else
MsgBox("Anak melebihi kuota!!!!", MsgBoxStyle.Information, Title:="gaji error")
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
Dim c As MsgBoxResult
c = MsgBox("kembali????", MsgBoxStyle.Question + vbYesNo, Title:="back")
If c = vbYes Then
Form1.Show()
Me.Hide()

Form1.TextBox1.Text = ""
Form1.TextBox2.Text = ""
Form1.TextBox3.Text = ""
Form1.TextBox4.Text = ""
Form1.TextBox1.Focus()
Else
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox7.Text = ""
TextBox1.Focus()
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim a, b, c As Double
Dim d As Double
a = Val(TextBox2.Text)
b = Val(TextBox3.Text)
c = Val(TextBox5.Text)
d=a+b+c
TextBox7.Text = Str(d)
End Sub

You might also like