i have 3 check boxes then you check each indivual box the amount shows up in the appropiate label. but if you check more that one it will not add the values together does anyone have any idea how to the checkbox values to add together when more that one box is selected?/ here are the check box code:

Private Sub GolfCheckBox_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles GolfCheckBox.Click
        If Me.GolfCheckBox.Checked = True Then
            mintAdditional = 25
        End If
        Me.AdditionalLabel.Text = Format(mintAdditional, "currency")
End Sub

Private Sub RacquetballCheckBox_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RacquetballCheckBox.Click
    If Me.RacquetballCheckBox.Checked = True Then
        mintAdditional = 20
    End If
    Me.AdditionalLabel.Text = Format(mintAdditional, "currency")
End Sub

Private Sub TennisCheckBox_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TennisCheckBox.Click
    If Me.TennisCheckBox.Checked = True Then
        mintAdditional = 30
    End If
    Me.AdditionalLabel.Text = Format(mintAdditional, "currency")
End Sub

Private Sub CalcButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CalcButton.Click
    Dim intBasic As Integer
    Dim sngTotal As Single
    intBasic = Val(Me.BasicTextBox.Text)
    Select Case True
        Case Me.TennisCheckBox.Checked = True
            sngTotal = intBasic + mintAdditional
        Case Me.RacquetballCheckBox.Checked = True
            sngTotal = intBasic + mintAdditional
        Case Me.GolfCheckBox.Checked = True
            sngTotal = intBasic + mintAdditional
    End Select
    Me.TotalLabel.Text = Format(sngTotal, "currency")
    Me.AdditionalLabel.Text = Format(mintAdditional, "currency")
End Sub

Mhm. Well I found it hard to follow your code and what exactly it does. But if I read correctly at the beginning you want to do the following:

Public Class Learning2

    Dim total As Double = 0
    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.Checked = True Then
            total = total + 30
        ElseIf CheckBox1.Checked = False And total <> 0 Then
            total = total - 30
        End If
        Label1.Text = FormatCurrency(total)
    End Sub
    
    Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
        If CheckBox2.Checked = True Then
            total = total + 15
        ElseIf CheckBox2.Checked = False And total <> 0 Then
            total = total - 15
        End If
        Label1.Text = FormatCurrency(total)
    End Sub

    Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged
        If CheckBox3.Checked = True Then
            total = total + 25
        ElseIf CheckBox3.Checked = False And total <> 0 Then
            total = total - 25
        End If
        Label1.Text = FormatCurrency(total)
    End Sub

    Private Sub Learning2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Label1.Text = FormatCurrency(total)
    End Sub
End Class

I've little or no idea how to help you with your code though sorry as I find it hard to debug others code.

By the looks of things though you just keep on replacing the sngTotal instead of adding things on.

Just ask if you need any more help :)

EDIT: Oh yeh, all my checkbox names are default and the prices are just test numbers, so just change as you need :)

This article has been dead for over six months. Start a new discussion instead.