Private textboxArray() As TextBox
Private checkboxArray() As CheckBox
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
textboxArray = New TextBox() {tbxSelfPt, tbxTattoosPt, tbxSymbolismPt, tbxdocsPt, tbxPubsPt, tbxAuthorshipPt, tbxCourtRecsPt, tbxPhotosPt, tbxAssociationPt, tbxContactsPt, tbxCInformationPt, tbxMembershipPt, tbxAgenciesPt, tbxMediaPt}
checkboxArray = New CheckBox() {cbxSelf, cbxTattoos, cbxSymbolism, cbxDocs, cbxPubs, cbxAuthorship, cbxCourtRecs, cbxPhotos, cbxAssociation, cbxContacts, cbxCInformation, cbxmembership, cbxAgencies, cbxMedia}
StatusBarPanel2.Text = Date.Today
End Sub
Private Sub textboxes_textchanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles tbxSelfPt.TextChanged, tbxTattoosPt.TextChanged, tbxSymbolismPt.TextChanged, tbxdocsPt.TextChanged, tbxPubsPt.TextChanged, tbxAuthorshipPt.TextChanged, tbxCourtRecsPt.TextChanged, tbxPhotosPt.TextChanged, tbxAssociationPt.TextChanged, tbxContactsPt.TextChanged, tbxCInformationPt.TextChanged, tbxMembershipPt.TextChanged, tbxAgenciesPt.TextChanged, tbxMediaPt.TextChanged
doTotal()
End Sub
Private Sub checkboxes_checkchanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles cbxSelf.CheckedChanged, cbxTattoos.CheckedChanged, cbxSymbolism.CheckedChanged, cbxDocs.CheckedChanged, cbxPubs.CheckedChanged, cbxAuthorship.CheckedChanged, cbxCourtRecs.CheckedChanged, cbxPhotos.CheckedChanged, cbxAssociation.CheckedChanged, cbxContacts.CheckedChanged, cbxCInformation.CheckedChanged, cbxmembership.CheckedChanged, cbxAgencies.CheckedChanged, cbxMedia.CheckedChanged
If cbxSelf.Checked = True Then
tbxSelfPt.Text = "5"
Else
tbxSelfPt.Text = ""
End If
If cbxTattoos.Checked = True Then
tbxTattoosPt.Text = "7"
Else
tbxTattoosPt.Text = ""
End If
If cbxSymbolism.Checked = True Then
tbxSymbolismPt.Text = "2"
Else
tbxSymbolismPt.Text = ""
End If
If cbxDocs.Checked = True Then
tbxdocsPt.Text = "5"
Else
tbxdocsPt.Text = ""
End If
If cbxPubs.Checked = True Then
tbxPubsPt.Text = "1"
Else
tbxPubsPt.Text = ""
End If
If cbxAuthorship.Checked = True Then
tbxAuthorshipPt.Text = "7"
Else
tbxAuthorshipPt.Text = ""
End If
If cbxCourtRecs.Checked = True Then
tbxCourtRecsPt.Text = "9"
Else
tbxCourtRecsPt.Text = ""
End If
If cbxPhotos.Checked = True Then
tbxPhotosPt.Text = "2"
Else
tbxPhotosPt.Text = ""
End If
If cbxAssociation.Checked = True Then
tbxAssociationPt.Text = "2"
Else
tbxAssociationPt.Text = ""
End If
If cbxContacts.Checked = True Then
tbxContactsPt.Text = "2"
Else
tbxContactsPt.Text = ""
End If
If cbxCInformation.Checked = True Then
tbxCInformationPt.Text = "2"
Else
tbxCInformationPt.Text = ""
End If
If cbxmembership.Checked = True Then
tbxMembershipPt.Text = "9"
Else
tbxMembershipPt.Text = ""
End If
If cbxAgencies.Checked = True Then
tbxAgenciesPt.Text = "8"
Else
tbxAgenciesPt.Text = ""
End If
If cbxMedia.Checked = True Then
tbxMediaPt.Text = "5"
Else
tbxMediaPt.Text = ""
End If
doTotal()
End Sub
Private Sub doTotal()
Dim total As Decimal = 0
For x As Integer = 1 To 14
If checkboxArray(x - 1).Checked Then
total += CDec(Val(textboxArray(x - 1).Text))
Else
total -= CDec(Val(textboxArray(x - 1).Text))
End If
Next
tbxTotalPt.Text = CStr(total)
End Sub
Private Sub StatusBar1_PanelClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.StatusBarPanelClickEventArgs) Handles StatusBar1.PanelClick
StatusBarPanel1.Text = Date.Now
End Sub
End Class