indigo
Member
- Joined
- Mar 22, 2010
- Messages
- 5
- Programming Experience
- Beginner
VB.NET:
Option Strict On
Public Class frmParkingTickets
Private Sub frmParkingTickets_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub pnlViolations_GotFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pnlViolations.GotFocus
End Sub
'the btnDisplayFine event handler calculates the amount of the ticket based on user input.
Private Sub btnDisplayFine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplayFine.Click
'Declaration Section
Dim decTicketTotal As Decimal
Dim decExpiredMeter As Decimal = 35D
Dim decNoParkingZone As Decimal = 75D
Dim decBlockingDriveway As Decimal = 150D
Dim decIllegalHandicap As Decimal = 500D
' Determine Cost of Ticket
If Me.radExpiredMeter.Checked Then
decTicketTotal = decExpiredMeter
ElseIf Me.radNoParkingZone.Checked Then
decTicketTotal = decNoParkingZone
ElseIf Me.radBlockingDriveway.Checked Then
decTicketTotal = decBlockingDriveway
ElseIf Me.radIllegalHandicap.Checked Then
decTicketTotal = decIllegalHandicap
End If
'Calculate and display the cost of the ticket
Me.lblTicketTotal.Text = decTicketTotal.ToString("C")
End Sub
right now i have the following code. it is 4 radio buttons that if selected will display the price of a ticket.
there is a button called "repeat offender" that should take the price and double it. so me, being new to visual basic, were thinking of trying an if statement such as If it is selected decTicketTotal * 2
but this did not work. any help would be appreciated.. just trying to get the repeat offender selection working so when it calculates the price will double.