Expand|Select|Wrap|Line Numbers
- [CODE Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click
- btnCalculate.Enabled = True
- btnCustomer.Enabled = False
- Dim decTotal As Decimal
- Dim intHours As Integer
- intHours = CInt(txtHours.Text)
- If CInt(txtHours.Text) > 744 Then
- MessageBox.Show("Monthly Hours Can't Exceed 744")
- txtHours.Text = String.Empty
- lblTotal.Text = String.Empty
- End If
- If radA.Checked = False AndAlso radB.Checked = False AndAlso radC.Checked = False Then
- MessageBox.Show("Please select an internet package to proceed")
- btnTotal.Enabled = False
- End If
- If radA.Checked AndAlso intHours > 10 Then
- decTotal = CDec((9.95 + ((intHours - 10) * 2)))
- ElseIf radA.Checked AndAlso intHours <= 10 Then
- decTotal = CDec(9.95)
- End If
- If radB.Checked AndAlso intHours > 20 Then
- decTotal = CDec((14.95 + ((intHours - 20) * 1)))
- ElseIf radB.Checked AndAlso intHours <= 20 Then
- decTotal = CDec(14.95)
- End If
- If radC.Checked Then
- decTotal = CDec(19.95)
- End If
- lblTotal.Text = decTotal.ToString("c")
- If (txtHours.Text.Length > 0) Then
- intHours = CInt(txtHours.Text)
- Else
- MsgBox("Please enter an amount of hours")
- Exit Sub
- End If
- End Sub
- Private Sub btnTotal_Click(sender As Object, e As EventArgs) Handles btnTotal.Click
- Dim decPackA As Integer
- Dim decPackB As Integer
- Dim decPackC As Integer
- Dim decPackAHours As Integer
- Dim decPackBHours As Integer
- Dim decPackCHours As Integer
- Dim GrandTotal As Integer
- Dim inthours As Integer
- Dim decTotal As Integer
- If radA.Checked AndAlso inthours > 10 Then
- decTotal = CInt(CDec((9.95 + ((inthours - 10) * 2))))
- decPackA = decPackA + decTotal
- decPackAHours = decPackAHours + inthours
- ElseIf radA.Checked AndAlso inthours <= 10 Then
- decTotal = CInt(CDec(9.95))
- decPackA = decPackA + decTotal
- decPackAHours = decPackAHours + inthours
- End If
- If radB.Checked AndAlso inthours > 20 Then
- decTotal = CInt(CDec((14.95 + ((inthours - 20) * 1))))
- decPackB = decPackB + decTotal
- decPackBHours = decPackBHours + inthours
- End If
- If radC.Checked AndAlso inthours <= 20 Then
- decTotal = CInt(CDec(19.95))
- decPackC = decPackC + decTotal
- decPackCHours = decPackCHours + inthours
- GrandTotal = decPackA + decPackB + decPackC
- End If
- End Sub
- Private Sub btnReset_Click(sender As Object, e As EventArgs) Handles btnReset.Click
- radA.Checked = False
- radB.Checked = False
- radC.Checked = False
- cbNonProfit.Checked = False
- lblTotal.Text = String.Empty
- txtHours.Text = String.Empty
- txtName.Clear()
- txtCityState.Clear()
- txtName.Focus()
- btnCustomer.Enabled = True
- btnCalculate.Enabled = False
- btnTotal.Enabled = False
- End Sub
- Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
- Dim GrandTotal As Integer
- Dim decPackA, decPackB, decPackC As Decimal
- GrandTotal = CInt(decPackA + decPackB + decPackC)
- GrandTotal = CInt("Package A: " & decPackA.ToString("c"))
- GrandTotal = CInt("Package B: " & decPackB.ToString("c"))
- GrandTotal = CInt("Package C: " & decPackC.ToString("c"))
- Me.Close()
- End Sub]
I am trying to get a messagebox in the Click even exit button to display with Package = hours = price it is not working