Guest User

Untitled

a guest
Jun 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' Name:         Total Sales Project
  2. ' Purpose:      Calculates the total of the sales amounts entered by the user
  3. ' Programmer:   Roy Hammond on 2/8/12
  4.  
  5. Option Explicit On
  6. Option Strict On
  7. Option Infer Off
  8.  
  9. Public Class frmMain
  10.  
  11.     ' class-level variable used to store the total sales
  12.    Private decTotal As Decimal
  13.  
  14.     Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
  15.         Me.Close()
  16.     End Sub
  17.  
  18.     Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  19.  
  20.     End Sub
  21.  
  22.     Private Sub btnCalc_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCalc.Click
  23.         ' calculates the total sales.
  24.  
  25.         ' declare variable, this one procedure specific
  26.        Dim decSales As Decimal
  27.  
  28.         ' procedure to calculate and display the total sales
  29.        Decimal.TryParse(txtSales.Text, decSales)
  30.         decTotal = decTotal + decSales
  31.         lblTotalSales.Text = Convert.ToString(decTotal)
  32.         ' set the focus...?  send the focus BACK to the txtsales?
  33.        txtSales.Focus()
  34.     End Sub
  35. End Class
Add Comment
Please, Sign In to add comment