Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. ' Program: New York City Broadway Tickets
  2. ' Author: Lindsey Leahey
  3. ' Date: November 3, 2010
  4. ' Purpose: The Broadway tickets selection program allows a user to purchase
  5. ' tickets to a theater production.
  6.  
  7. Option Strict On
  8.  
  9. Public Class frmBroadwayTickets
  10.  
  11. ' Cost per ticket - used in multiple procedures
  12. Const _cdecPricePerTicket As Decimal = 153.5D
  13.  
  14. Private Sub btnCalculateCost_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplayCost.Click
  15. ' This event handler is executed when the user clicks the
  16. ' display Cost button. It calculates and displays the cost
  17. ' of tickets (number of tickets times the cost per ticket).
  18.  
  19. Dim strNumberofTickets As String
  20. Dim intNumberofTickets As Integer
  21. Dim decTotalCostOfTickets As Decimal
  22.  
  23. strNumberofTickets = txtNumberOfTickets.Text
  24. intNumberofTickets = Convert.ToInt32(strNumberofTickets)
  25. decTotalCostOfTickets = intNumberofTickets * _cdecPricePerTicket
  26. lblTotalCostOfTickets.Text = decTotalCostOfTickets.ToString("C")
  27.  
  28. End Sub
  29.  
  30. Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
  31. ' This even handler is executed when the user clicks the
  32. ' Clear button. It clears the number of songs text box
  33. ' and the Text property of the Total Cost of Tickets label.
  34. ' Then, it sets the focus on the txtNumberOfSongs TextBox object.
  35.  
  36. txtNumberofTickets.Clear()
  37. lblTotalCostOfTickets.Text = ""
  38. txtNumberofTickets.Focus()
  39.  
  40. End Sub
  41.  
  42. Private Sub frmDigitalDownloads_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  43. ' This even handler is executed when the form is loaded.
  44. ' It displays the cost heading, clears the Text property of the
  45. ' Total Cost of Tickets label, and sets the focus on
  46. ' the txtNumberofTickets TextBox object.
  47.  
  48. lblCostHeading.Text = _cdecPricePerTicket.ToString("C") & " Per Download"
  49. lblTotalCostOfTickets.Text = ""
  50. txtNumberofTickets.Focus()
  51. End Sub
  52.  
  53. Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
  54. ' Close the window and terminate the application.
  55.  
  56. Close()
  57.  
  58. End Sub
  59. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement