Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Program: New York City Broadway Tickets
- ' Author: Lindsey Leahey
- ' Date: November 3, 2010
- ' Purpose: The Broadway tickets selection program allows a user to purchase
- ' tickets to a theater production.
- Option Strict On
- Public Class frmBroadwayTickets
- ' Cost per ticket - used in multiple procedures
- Const _cdecPricePerTicket As Decimal = 153.5D
- Private Sub btnCalculateCost_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplayCost.Click
- ' This event handler is executed when the user clicks the
- ' display Cost button. It calculates and displays the cost
- ' of tickets (number of tickets times the cost per ticket).
- Dim strNumberofTickets As String
- Dim intNumberofTickets As Integer
- Dim decTotalCostOfTickets As Decimal
- strNumberofTickets = txtNumberOfTickets.Text
- intNumberofTickets = Convert.ToInt32(strNumberofTickets)
- decTotalCostOfTickets = intNumberofTickets * _cdecPricePerTicket
- lblTotalCostOfTickets.Text = decTotalCostOfTickets.ToString("C")
- End Sub
- Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
- ' This even handler is executed when the user clicks the
- ' Clear button. It clears the number of songs text box
- ' and the Text property of the Total Cost of Tickets label.
- ' Then, it sets the focus on the txtNumberOfSongs TextBox object.
- txtNumberofTickets.Clear()
- lblTotalCostOfTickets.Text = ""
- txtNumberofTickets.Focus()
- End Sub
- Private Sub frmDigitalDownloads_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- ' This even handler is executed when the form is loaded.
- ' It displays the cost heading, clears the Text property of the
- ' Total Cost of Tickets label, and sets the focus on
- ' the txtNumberofTickets TextBox object.
- lblCostHeading.Text = _cdecPricePerTicket.ToString("C") & " Per Download"
- lblTotalCostOfTickets.Text = ""
- txtNumberofTickets.Focus()
- End Sub
- Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
- ' Close the window and terminate the application.
- Close()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement