Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Name: Total Sales Project
- ' Purpose: Calculates the total of the sales amounts entered by the user
- ' Programmer: Roy Hammond on 2/8/12
- Option Explicit On
- Option Strict On
- Option Infer Off
- Public Class frmMain
- ' class-level variable used to store the total sales
- Private decTotal As Decimal
- Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
- Me.Close()
- End Sub
- Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- End Sub
- Private Sub btnCalc_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCalc.Click
- ' calculates the total sales.
- ' declare variable, this one procedure specific
- Dim decSales As Decimal
- ' procedure to calculate and display the total sales
- Decimal.TryParse(txtSales.Text, decSales)
- decTotal = decTotal + decSales
- lblTotalSales.Text = Convert.ToString(decTotal)
- ' set the focus...? send the focus BACK to the txtsales?
- txtSales.Focus()
- End Sub
- End Class
Add Comment
Please, Sign In to add comment