0% found this document useful (0 votes)
46 views4 pages

Formlogin: "" "" "Isi Terlebih Dahulu" "1234" "Kelompok14"

The document contains code for three forms - FormLogIn, Form2, and Form1. FormLogIn handles login authentication. Form2 calculates control limits from data and plots a chart. Form1 allows input of sample data, calculates defects total and control limit, and passes data to Form2.

Uploaded by

rafsa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views4 pages

Formlogin: "" "" "Isi Terlebih Dahulu" "1234" "Kelompok14"

The document contains code for three forms - FormLogIn, Form2, and Form1. FormLogIn handles login authentication. Form2 calculates control limits from data and plots a chart. Form1 allows input of sample data, calculates defects total and control limit, and passes data to Form2.

Uploaded by

rafsa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Public Class FormLogIn

Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles


CheckBox1.CheckedChanged
If CheckBox1.CheckState = CheckState.Checked Then
TextBoxPassword.UseSystemPasswordChar = False
Else
TextBoxPassword.UseSystemPasswordChar = True
End If
End Sub

Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load


TextBoxPassword.UseSystemPasswordChar = True
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click


End
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


If TextBoxPassword.Text = "" Or TextBoxUsername.Text = "" Then
MsgBox("Isi Terlebih Dahulu")

ElseIf TextBoxPassword.Text = "1234" And TextBoxUsername.Text = "kelompok14"


Then
Form1.Show()
Me.Hide()
Else
MsgBox("Kata Sandi atau Nama Pengguna Salah")
End If

End Sub
End Class

Public Class Form2

Private Sub TextBoxCLForm2_TextChanged(sender As Object, e As EventArgs) Handles


TextBoxCLForm2.TextChanged
TextBoxCLForm2.Text = Form1.TextBoxCL.Text
End Sub

Private Sub ButtonHitungUCL_Click(sender As Object, e As EventArgs) Handles


ButtonHitungUCL.Click
Dim ucl As Double
Dim lcl As Double
ucl = Val(TextBoxCLForm2.Text) + 3 * ((Val(TextBoxCLForm2.Text)) ^ 0.5)
TextBoxHasilUCL.Text = ucl

lcl = Val(TextBoxCLForm2.Text) - 3 * Val(TextBoxCLForm2.Text) ^ 0.5


TextBoxHasilLCL.Text = lcl

Button1.Enabled = True
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


Chart1.Series(0).ChartType = DataVisualization.Charting.SeriesChartType.Line
For Count As Integer = 0 To Form1.DataGridView1.Rows.Count - 2
Chart1.Series("Proporsi Data").Points.AddXY(Form1.DataGridView1.Item(0,
Count).Value, Form1.DataGridView1.Item(2, Count).Value)
Chart1.Series("UCL").Points.Add(TextBoxHasilUCL.Text)
Chart1.Series("LCL").Points.Add(TextBoxHasilLCL.Text)
Chart1.Series("CL").Points.Add(TextBoxCLForm2.Text)
Next

Button2.Enabled = True
ButtonEnd.Enabled = True
End Sub

Private Sub ButtonPerbaikan_Click(sender As Object, e As EventArgs)


Form1.Show()
Me.Hide()
Hide()
Form1.TextBoxCL.Clear()
Form1.TextBoxTotalDataCacat.Clear()
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click


Form1.Show()
Me.Hide()

Chart1.Series("CL").Points.Clear()
Chart1.Series("UCL").Points.Clear()
Chart1.Series("LCL").Points.Clear()
Chart1.Series("Proporsi Data").Points.Clear()

TextBoxCLForm2.Clear()
TextBoxHasilLCL.Clear()
TextBoxHasilUCL.Clear()
Form1.TextBoxCL.Clear()
Form1.TextBoxTotalDataCacat.Clear()

Form1.ButtonHitungCL.Enabled = False
Form1.ButtonNextForm2.Enabled = False
Button1.Enabled = False
Button2.Enabled = False
ButtonEnd.Enabled = False
End Sub

Private Sub ButtonEnd_Click(sender As Object, e As EventArgs) Handles


ButtonEnd.Click
End
End Sub

End Class
Public Class Form1

Private Sub ButtonInputKaretTanggal_Click(sender As Object, e As EventArgs)


Handles ButtonInputKaretTanggal.Click
If DateTimePicker1.Text = "" Or TextBoxJumlahKaret.Text = "" Or
TextBoxProporsi.Text = "" Then
MessageBox.Show("Lengkapi Data", "Gagal Menyimpan.",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning)

Else
DataGridView1.Rows.Add(1)
DataGridView1.Rows(DataGridView1.RowCount - 2).Cells(0).Value =
DateTimePicker1.Text
DataGridView1.Rows(DataGridView1.RowCount - 2).Cells(1).Value =
TextBoxJumlahKaret.Text
DataGridView1.Rows(DataGridView1.RowCount - 2).Cells(2).Value =
TextBoxProporsi.Text
DataGridView1.Update()

TextBoxJumlahKaret.Clear()
TextBoxProporsi.Clear()

End If

ButtonHitungTotalDataCacat.Enabled = True
End Sub

Private Sub ButtonHitungTotalDataCacat_Click(sender As Object, e As EventArgs)


Handles ButtonHitungTotalDataCacat.Click
Dim total As Integer
For i As Integer = 0 To DataGridView1.Rows.Count - 1
total = total + Val(DataGridView1.Rows(i).Cells(1).Value)
Next
TextBoxTotalDataCacat.Text = total

ButtonHitungCL.Enabled = True
End Sub

Private Sub ButtonHitungCL_Click(sender As Object, e As EventArgs) Handles


ButtonHitungCL.Click
Dim JumlahTanggal As Integer
Dim CL As Double

For i As Integer = 0 To DataGridView1.Rows.Count - 1


JumlahTanggal = DataGridView1.Rows.Count - 1
Next
CL = Val(TextBoxTotalDataCacat.Text) / (Val(TextBoxJumlahSampel.Text) *
DataGridView1.Rows.Count - 1)

TextBoxCL.Text = CL
ButtonNextForm2.Enabled = True
End Sub

Private Sub ButtonHapus_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles ButtonHapus.Click
If DataGridView1.CurrentRow.Index <> DataGridView1.NewRowIndex Then
DataGridView1.Rows.RemoveAt(DataGridView1.CurrentRow.Index)
End If

End Sub
Private Sub ButtonNextForm2_Click(sender As Object, e As EventArgs) Handles
ButtonNextForm2.Click
Form2.TextBoxCLForm2.Text = TextBoxCL.Text
Form2.Show()
Me.Hide()

ButtonHitungCL.Enabled = True
End Sub

Private Sub TextBoxJumlahKaret_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles TextBoxJumlahKaret.KeyPress
If Not (e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = vbBack) Then
e.Handled = True
End Sub

Private Sub TextBoxTotalDataCacat_KeyPress(sender As Object, e As


KeyPressEventArgs) Handles TextBoxTotalDataCacat.KeyPress
If Not (e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = vbBack) Then
e.Handled = True
End Sub

Private Sub TextBoxCL_KeyPress(sender As Object, e As KeyPressEventArgs) Handles


TextBoxCL.KeyPress
If Not (e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = vbBack) Then
e.Handled = True
End Sub

Private Sub TextBoxJumlahSampel_KeyPress(sender As Object, e As KeyPressEventArgs)


Handles TextBoxJumlahSampel.KeyPress
If Not (e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = vbBack) Then
e.Handled = True
End Sub

Private Sub ButtonInputJumlahSampel_Click(sender As Object, e As EventArgs)


Handles ButtonInputJumlahSampel.Click
If TextBoxJumlahSampel.Text = " " Then
MessageBox.Show("Lengkapi Data", "Gagal Menyimpan.",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning)

Else
Label9.Text = Val(TextBoxJumlahSampel.Text)
Label9.Update()
ButtonProporsiData.Enabled = True
End If
End Sub

Private Sub ButtonProporsiData_Click(sender As Object, e As EventArgs) Handles


ButtonProporsiData.Click
Dim Proporsi As Double

TextBoxProporsi.Text = Val(TextBoxJumlahKaret.Text) /
Val(TextBoxJumlahSampel.Text)
Proporsi = Val(TextBoxProporsi.Text)
ButtonInputKaretTanggal.Enabled = True
ButtonInputJumlahSampel.Enabled = False
ButtonNextForm2.Enabled = False
ButtonHitungCL.Enabled = False
End Sub

End Class

You might also like