Advertisement
conception

yo

Feb 20th, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. Name: Timbers Solution
  2. ' Programmer: <Kariann Fenoglio> on <February 20, 2015>
  3. ' Class: CIS 230
  4. Public Class frmMain
  5.  
  6. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Calculate.Click
  7. ' calculate Discount and New Price
  8.  
  9. Dim origlPrice As Decimal
  10. Dim discRate As Decimal
  11. Dim discount As Decimal
  12. Dim newPrice As Decimal
  13.  
  14. Decimal.TryParse(TextBox1.Text, origlPrice)
  15. Decimal.TryParse(discount, discRate)
  16. origlPrice = TextBox1.Text
  17.  
  18. discount = origlPrice * 0.2
  19. newPrice = origlPrice - discount
  20.  
  21. LabelD.Text = Convert.ToString(discount)
  22. LabelNP.Text = Convert.ToString(newPrice)
  23.  
  24. LabelD.Text = Format(LabelD.Text, "Standard")
  25. LabelNP.Text = Format(LabelNP.Text, "Standard")
  26. TextBox1.Focus()
  27. End Sub
  28.  
  29. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles PrintForm1.Click
  30. ' Print the Receipt
  31.  
  32. Me.Width = Me.Width - 90
  33. PrintForm2.PrintAction = Printing.PrintAction.PrintToPreview
  34. PrintForm2.Print()
  35. Me.Width = Me.Width + 90
  36.  
  37.  
  38. End Sub
  39.  
  40. Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Clear.Click
  41. ' clear calculated amounts from labels
  42. TextBox1.Text = String.Empty
  43. LabelD.Text = String.Empty
  44. LabelNP.Text = String.Empty
  45. End Sub
  46.  
  47. Private Sub Button4_Click(sender As Object, e As EventArgs) Handles ExitButton.Click
  48. Me.Close()
  49. End Sub
  50.  
  51. Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
  52.  
  53. End Sub
  54.  
  55. Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
  56.  
  57. End Sub
  58.  
  59. Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
  60.  
  61. End Sub
  62.  
  63. Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
  64. ' Gets original price
  65.  
  66. End Sub
  67.  
  68. Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  69.  
  70. End Sub
  71.  
  72. Private Sub Label4_Click(sender As Object, e As EventArgs) Handles LabelD.Click
  73. 'Shows Discount
  74.  
  75. End Sub
  76.  
  77. Private Sub Label5_Click(sender As Object, e As EventArgs) Handles LabelNP.Click
  78. 'Shows NewPrice
  79.  
  80. End Sub
  81. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement