PROSEDUR LATIHAN 6:
Ø
Lanjutan
Ø
Pilih
“Add New Item” pada tool
Ø
Lalu
pilih “Windows Form” dan ganti nama yang di ingin kan kemudian pilih “Add”
Ø
Muncullah
form1.vb (Form1 bisa diganti)
Ø
Mulai
bekerja dengan menggunakan tool pada toolbox
Ø
Buat text pada form dengan menggunakan label, antara lain
v
“Makanan
Khas Makassar”
v
“Makanan”
v
“Harga”
v
“Qty”
v
“Jumlah”
v
“Coto”
v
“Pallubasa”
v
“Sop
Konro”
v
“Sop
Saudara”
v
“Konro
Bakar”
v
“Ulu
Juku”
v
“Total”
v
“Pot.
Member 10%”
v
“No.
Member”
v
“Jumlah
Bersih”
Ø Buat textbox sebanyak 31 tetapi property ReadOnly
textbox di atur jadi true.
Untuk lebih jelasnya lihat gambar d
bawah :
Ø
Setelah
selesai, maka kita masuk pada rumus yaitu :
Public Class Latihan_06_36001155
Private Sub M1_36001155_CheckedChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
M1_36001155.CheckedChanged
If
M1_36001155.Checked Then
H1_36001155.ReadOnly = False
Q1_36001155.ReadOnly = False
Else
H1_36001155.ReadOnly = True
Q1_36001155.ReadOnly = True
End If
End Sub
Private Sub Q1_36001155_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
Q1_36001155.TextChanged
J1_36001155.Text =
Val(H1_36001155.Text) * Val(Q1_36001155.Text)
T_36001155.Text = Val(J1_36001155.Text)
+ Val(J2_36001155.Text) + Val(J3_36001155.Text) + Val(J4_36001155.Text) +
Val(J5_36001155.Text) + Val(J6_36001155.Text)
End Sub
Private Sub pot_36001155_CheckedChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
Pot_36001155.CheckedChanged
If
Pot_36001155.Checked Then
P_36001155.Text =
Val(T_36001155.Text) * (10 / 100)
JB_36001155.Text =
Val(T_36001155.Text) - Val(P_36001155.Text)
End If
End Sub
Private Sub No_36001155_CheckedChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
No_36001155.CheckedChanged
If
No_36001155.Checked Then
P_36001155.Text = 0
JB_36001155.Text =
Val(T_36001155.Text) - Val(P_36001155.Text)
End If
End Sub
Private Sub M2_36001155_CheckedChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
M2_36001155.CheckedChanged
If
M2_36001155.Checked Then
H2_36001155.ReadOnly = False
Q2_36001155.ReadOnly = False
Else
H2_36001155.ReadOnly = True
Q2_36001155.ReadOnly = True
End If
End Sub
Private Sub M3_36001155_CheckedChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
M3_36001155.CheckedChanged
If M3_36001155.Checked
Then
H3_36001155.ReadOnly = False
Q3_36001155.ReadOnly = False
Else
H3_36001155.ReadOnly = True
Q3_36001155.ReadOnly = True
End If
End Sub
Private Sub M4_36001155_CheckedChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
M4_36001155.CheckedChanged
If
M4_36001155.Checked Then
H4_36001155.ReadOnly = False
Q4_36001155.ReadOnly = False
Else
H4_36001155.ReadOnly = True
Q4_36001155.ReadOnly = True
End If
End Sub
Private Sub M5_36001155_CheckedChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
M5_36001155.CheckedChanged
If
M5_36001155.Checked Then
H5_36001155.ReadOnly = False
Q5_36001155.ReadOnly = False
Else
H5_36001155.ReadOnly = True
Q5_36001155.ReadOnly = True
End If
End Sub
Private Sub M6_36001155_CheckedChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
M6_36001155.CheckedChanged
If
M6_36001155.Checked Then
H6_36001155.ReadOnly = False
Q6_36001155.ReadOnly = False
Else
H6_36001155.ReadOnly = True
Q6_36001155.ReadOnly = True
End If
End Sub
Private Sub Q2_36001155_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
Q2_36001155.TextChanged
J2_36001155.Text =
Val(H2_36001155.Text) * Val(Q2_36001155.Text)
T_36001155.Text = Val(J1_36001155.Text)
+ Val(J2_36001155.Text) + Val(J3_36001155.Text) + Val(J4_36001155.Text) +
Val(J5_36001155.Text) + Val(J6_36001155.Text)
End Sub
Private Sub Q3_36001155_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
Q3_36001155.TextChanged
J3_36001155.Text =
Val(H3_36001155.Text) * Val(Q3_36001155.Text)
T_36001155.Text = Val(J1_36001155.Text)
+ Val(J2_36001155.Text) + Val(J3_36001155.Text) + Val(J4_36001155.Text) +
Val(J5_36001155.Text) + Val(J6_36001155.Text)
End Sub
Private Sub Q4_36001155_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
Q4_36001155.TextChanged
J4_36001155.Text =
Val(H4_36001155.Text) * Val(Q4_36001155.Text)
T_36001155.Text = Val(J1_36001155.Text)
+ Val(J2_36001155.Text) + Val(J3_36001155.Text) + Val(J4_36001155.Text) +
Val(J5_36001155.Text) + Val(J6_36001155.Text)
End Sub
Private Sub
Q5_36001155_TextChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
Q5_36001155.TextChanged
J5_36001155.Text =
Val(H5_36001155.Text) * Val(Q5_36001155.Text)
T_36001155.Text = Val(J1_36001155.Text)
+ Val(J2_36001155.Text) + Val(J3_36001155.Text) + Val(J4_36001155.Text) +
Val(J5_36001155.Text) + Val(J6_36001155.Text)
End Sub
Private Sub Q6_36001155_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Q6_36001155.TextChanged
J6_36001155.Text =
Val(H6_36001155.Text) * Val(Q6_36001155.Text)
T_36001155.Text = Val(J1_36001155.Text)
+ Val(J2_36001155.Text) + Val(J3_36001155.Text) + Val(J4_36001155.Text) +
Val(J5_36001155.Text) + Val(J6_36001155.Text)
End Sub
End Class
Tidak ada komentar:
Posting Komentar