Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Name: Timbers Solution
- ' Programmer: <Kariann Fenoglio> on <February 20, 2015>
- ' Class: CIS 230
- Public Class frmMain
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Calculate.Click
- ' calculate Discount and New Price
- Dim origlPrice As Decimal
- Dim discRate As Decimal
- Dim discount As Decimal
- Dim newPrice As Decimal
- Decimal.TryParse(TextBox1.Text, origlPrice)
- Decimal.TryParse(discount, discRate)
- origlPrice = TextBox1.Text
- discount = origlPrice * 0.2
- newPrice = origlPrice - discount
- LabelD.Text = Convert.ToString(discount)
- LabelNP.Text = Convert.ToString(newPrice)
- LabelD.Text = Format(LabelD.Text, "Standard")
- LabelNP.Text = Format(LabelNP.Text, "Standard")
- TextBox1.Focus()
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles PrintForm1.Click
- ' Print the Receipt
- Me.Width = Me.Width - 90
- PrintForm2.PrintAction = Printing.PrintAction.PrintToPreview
- PrintForm2.Print()
- Me.Width = Me.Width + 90
- End Sub
- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Clear.Click
- ' clear calculated amounts from labels
- TextBox1.Text = String.Empty
- LabelD.Text = String.Empty
- LabelNP.Text = String.Empty
- End Sub
- Private Sub Button4_Click(sender As Object, e As EventArgs) Handles ExitButton.Click
- Me.Close()
- End Sub
- Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
- End Sub
- Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
- End Sub
- Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
- End Sub
- Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
- ' Gets original price
- End Sub
- Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- End Sub
- Private Sub Label4_Click(sender As Object, e As EventArgs) Handles LabelD.Click
- 'Shows Discount
- End Sub
- Private Sub Label5_Click(sender As Object, e As EventArgs) Handles LabelNP.Click
- 'Shows NewPrice
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement