'Program Name:  Transportation

'Programmer:    Bradley Shedd

'Date:          July 18, 2006

'Description:   This project calculates the amount due

'               based on the customer selection

'               and accumulates summary data for the day.

'               Incorporates menus and common dialog boxes,

'               which allow you to change the font and

'               color of labels.

'Folder:        Transportation

 

Option Strict On

 

    Public Class frmTransportation

        Inherits System.Windows.Forms.Form

 

#Region " Windows Form Designer generated code "

 

        Public Sub New()

            MyBase.New()

 

            'This call is required by the Windows Form Designer.

            InitializeComponent()

 

            'Add any initialization after the InitializeComponent() call

 

        End Sub

 

        'Form overrides dispose to clean up the component list.

        Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

            If disposing Then

                If Not (components Is Nothing) Then

                    components.Dispose()

                End If

            End If

            MyBase.Dispose(disposing)

        End Sub

 

        'Required by the Windows Form Designer

        Private components As System.ComponentModel.IContainer

 

        'NOTE: The following procedure is required by the Windows Form Designer

        'It can be modified using the Windows Form Designer. 

        'Do not modify it using the code editor.

        Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox

        Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox

        Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox

        Friend WithEvents radAtlanta As System.Windows.Forms.RadioButton

        Friend WithEvents radSavannah As System.Windows.Forms.RadioButton

        Friend WithEvents radValdosta As System.Windows.Forms.RadioButton

        Friend WithEvents radDowntownAtlanta As System.Windows.Forms.RadioButton

        Friend WithEvents radDowntownSavannah As System.Windows.Forms.RadioButton

    Friend WithEvents txtPassangers As System.Windows.Forms.TextBox

        Friend WithEvents chkTax As System.Windows.Forms.CheckBox

        Friend WithEvents Label2 As System.Windows.Forms.Label

        Friend WithEvents Label3 As System.Windows.Forms.Label

        Friend WithEvents Label4 As System.Windows.Forms.Label

        Friend WithEvents Label5 As System.Windows.Forms.Label

        Friend WithEvents lblItemAmount As System.Windows.Forms.Label

        Friend WithEvents lblSubTotal As System.Windows.Forms.Label

        Friend WithEvents lblTax As System.Windows.Forms.Label

        Friend WithEvents lblTotal As System.Windows.Forms.Label

        Friend WithEvents btnCalculate As System.Windows.Forms.Button

        Friend WithEvents btnClear As System.Windows.Forms.Button

        Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu

        Friend WithEvents mnuFile As System.Windows.Forms.MenuItem

        Friend WithEvents mnuFileNew As System.Windows.Forms.MenuItem

        Friend WithEvents mnuFileSummary As System.Windows.Forms.MenuItem

        Friend WithEvents mnuFileExit As System.Windows.Forms.MenuItem

        Friend WithEvents mnuEdit As System.Windows.Forms.MenuItem

        Friend WithEvents mnuEditCalc As System.Windows.Forms.MenuItem

        Friend WithEvents mnuEditClear As System.Windows.Forms.MenuItem

        Friend WithEvents mnuEditFont As System.Windows.Forms.MenuItem

        Friend WithEvents mnuEditColor As System.Windows.Forms.MenuItem

        Friend WithEvents mnuHelp As System.Windows.Forms.MenuItem

        Friend WithEvents mnuHelpAbout As System.Windows.Forms.MenuItem

        Friend WithEvents dlgColor As System.Windows.Forms.ColorDialog

        Friend WithEvents dlgFont As System.Windows.Forms.FontDialog

    Friend WithEvents Label1 As System.Windows.Forms.Label

    Friend WithEvents picTrain As System.Windows.Forms.PictureBox

    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmTransportation))

        Me.GroupBox1 = New System.Windows.Forms.GroupBox

        Me.btnClear = New System.Windows.Forms.Button

        Me.btnCalculate = New System.Windows.Forms.Button

        Me.lblItemAmount = New System.Windows.Forms.Label

        Me.Label2 = New System.Windows.Forms.Label

        Me.chkTax = New System.Windows.Forms.CheckBox

        Me.txtPassangers = New System.Windows.Forms.TextBox

        Me.Label1 = New System.Windows.Forms.Label

        Me.GroupBox2 = New System.Windows.Forms.GroupBox

        Me.radDowntownSavannah = New System.Windows.Forms.RadioButton

        Me.radDowntownAtlanta = New System.Windows.Forms.RadioButton

        Me.radValdosta = New System.Windows.Forms.RadioButton

        Me.radSavannah = New System.Windows.Forms.RadioButton

        Me.radAtlanta = New System.Windows.Forms.RadioButton

        Me.GroupBox3 = New System.Windows.Forms.GroupBox

        Me.lblTotal = New System.Windows.Forms.Label

        Me.lblTax = New System.Windows.Forms.Label

        Me.lblSubTotal = New System.Windows.Forms.Label

        Me.Label5 = New System.Windows.Forms.Label

        Me.Label4 = New System.Windows.Forms.Label

        Me.Label3 = New System.Windows.Forms.Label

        Me.MainMenu1 = New System.Windows.Forms.MainMenu

        Me.mnuFile = New System.Windows.Forms.MenuItem

        Me.mnuFileNew = New System.Windows.Forms.MenuItem

        Me.mnuFileSummary = New System.Windows.Forms.MenuItem

        Me.mnuFileExit = New System.Windows.Forms.MenuItem

        Me.mnuEdit = New System.Windows.Forms.MenuItem

        Me.mnuEditCalc = New System.Windows.Forms.MenuItem

        Me.mnuEditClear = New System.Windows.Forms.MenuItem

        Me.mnuEditFont = New System.Windows.Forms.MenuItem

        Me.mnuEditColor = New System.Windows.Forms.MenuItem

        Me.mnuHelp = New System.Windows.Forms.MenuItem

        Me.mnuHelpAbout = New System.Windows.Forms.MenuItem

        Me.dlgColor = New System.Windows.Forms.ColorDialog

        Me.dlgFont = New System.Windows.Forms.FontDialog

        Me.picTrain = New System.Windows.Forms.PictureBox

        Me.GroupBox1.SuspendLayout()

        Me.GroupBox2.SuspendLayout()

        Me.GroupBox3.SuspendLayout()

        Me.SuspendLayout()

        '

        'GroupBox1

        '

        Me.GroupBox1.Controls.Add(Me.btnClear)

        Me.GroupBox1.Controls.Add(Me.btnCalculate)

        Me.GroupBox1.Controls.Add(Me.lblItemAmount)

        Me.GroupBox1.Controls.Add(Me.Label2)

        Me.GroupBox1.Controls.Add(Me.chkTax)

        Me.GroupBox1.Controls.Add(Me.txtPassangers)

        Me.GroupBox1.Controls.Add(Me.Label1)

        Me.GroupBox1.Controls.Add(Me.GroupBox2)

        Me.GroupBox1.Location = New System.Drawing.Point(16, 16)

        Me.GroupBox1.Name = "GroupBox1"

        Me.GroupBox1.Size = New System.Drawing.Size(512, 184)

        Me.GroupBox1.TabIndex = 0

        Me.GroupBox1.TabStop = False

        Me.GroupBox1.Text = "Ticket Information"

        '

        'btnClear

        '

        Me.btnClear.DialogResult = System.Windows.Forms.DialogResult.Cancel

        Me.btnClear.Location = New System.Drawing.Point(344, 80)

        Me.btnClear.Name = "btnClear"

        Me.btnClear.Size = New System.Drawing.Size(144, 40)

        Me.btnClear.TabIndex = 7

        Me.btnClear.Text = "C&lear for Next Customer"

        '

        'btnCalculate

        '

        Me.btnCalculate.Location = New System.Drawing.Point(208, 80)

        Me.btnCalculate.Name = "btnCalculate"

        Me.btnCalculate.Size = New System.Drawing.Size(120, 40)

        Me.btnCalculate.TabIndex = 6

        Me.btnCalculate.Text = "&Calculate Selection"

        '

        'lblItemAmount

        '

        Me.lblItemAmount.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D

        Me.lblItemAmount.Location = New System.Drawing.Point(312, 136)

        Me.lblItemAmount.Name = "lblItemAmount"

        Me.lblItemAmount.TabIndex = 5

        '

        'Label2

        '

        Me.Label2.Location = New System.Drawing.Point(232, 144)

        Me.Label2.Name = "Label2"

        Me.Label2.Size = New System.Drawing.Size(80, 23)

        Me.Label2.TabIndex = 4

        Me.Label2.Text = "Item Amount"

        '

        'chkTax

        '

        Me.chkTax.Location = New System.Drawing.Point(256, 48)

        Me.chkTax.Name = "chkTax"

        Me.chkTax.TabIndex = 3

        Me.chkTax.Text = "Ci&tizen?"

        '

        'txtPassangers

        '

        Me.txtPassangers.Location = New System.Drawing.Point(296, 16)

        Me.txtPassangers.Name = "txtPassangers"

        Me.txtPassangers.TabIndex = 2

        Me.txtPassangers.Text = ""

        '

        'Label1

        '

        Me.Label1.Location = New System.Drawing.Point(232, 24)

        Me.Label1.Name = "Label1"

        Me.Label1.Size = New System.Drawing.Size(72, 23)

        Me.Label1.TabIndex = 1

        Me.Label1.Text = "&Passangers"

        '

        'GroupBox2

        '

        Me.GroupBox2.Controls.Add(Me.radDowntownSavannah)

        Me.GroupBox2.Controls.Add(Me.radDowntownAtlanta)

        Me.GroupBox2.Controls.Add(Me.radValdosta)

        Me.GroupBox2.Controls.Add(Me.radSavannah)

        Me.GroupBox2.Controls.Add(Me.radAtlanta)

        Me.GroupBox2.Location = New System.Drawing.Point(16, 24)

        Me.GroupBox2.Name = "GroupBox2"

        Me.GroupBox2.Size = New System.Drawing.Size(168, 144)

        Me.GroupBox2.TabIndex = 0

        Me.GroupBox2.TabStop = False

        Me.GroupBox2.Text = "Destination"

        '

        'radDowntownSavannah

        '

        Me.radDowntownSavannah.Location = New System.Drawing.Point(8, 112)

        Me.radDowntownSavannah.Name = "radDowntownSavannah"

        Me.radDowntownSavannah.Size = New System.Drawing.Size(144, 24)

        Me.radDowntownSavannah.TabIndex = 4

        Me.radDowntownSavannah.Text = "&Downtown Savannah"

        '

        'radDowntownAtlanta

        '

        Me.radDowntownAtlanta.Location = New System.Drawing.Point(8, 88)

        Me.radDowntownAtlanta.Name = "radDowntownAtlanta"

        Me.radDowntownAtlanta.Size = New System.Drawing.Size(128, 24)

        Me.radDowntownAtlanta.TabIndex = 3

        Me.radDowntownAtlanta.Text = "&Downtown Atlanta"

        '

        'radValdosta

        '

        Me.radValdosta.Location = New System.Drawing.Point(8, 64)

        Me.radValdosta.Name = "radValdosta"

        Me.radValdosta.TabIndex = 2

        Me.radValdosta.Text = "Va&ldosta"

        '

        'radSavannah

        '

        Me.radSavannah.Location = New System.Drawing.Point(8, 40)

        Me.radSavannah.Name = "radSavannah"

        Me.radSavannah.TabIndex = 1

        Me.radSavannah.Text = "Savanna&h"

        '

        'radAtlanta

        '

        Me.radAtlanta.Checked = True

        Me.radAtlanta.Location = New System.Drawing.Point(8, 16)

        Me.radAtlanta.Name = "radAtlanta"

        Me.radAtlanta.TabIndex = 0

        Me.radAtlanta.TabStop = True

        Me.radAtlanta.Text = "&Atlanta"

        '

        'GroupBox3

        '

        Me.GroupBox3.Controls.Add(Me.lblTotal)

        Me.GroupBox3.Controls.Add(Me.lblTax)

        Me.GroupBox3.Controls.Add(Me.lblSubTotal)

        Me.GroupBox3.Controls.Add(Me.Label5)

        Me.GroupBox3.Controls.Add(Me.Label4)

        Me.GroupBox3.Controls.Add(Me.Label3)

        Me.GroupBox3.Location = New System.Drawing.Point(16, 208)

        Me.GroupBox3.Name = "GroupBox3"

        Me.GroupBox3.Size = New System.Drawing.Size(264, 136)

        Me.GroupBox3.TabIndex = 1

        Me.GroupBox3.TabStop = False

        '

        'lblTotal

        '

        Me.lblTotal.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D

        Me.lblTotal.Location = New System.Drawing.Point(136, 72)

        Me.lblTotal.Name = "lblTotal"

        Me.lblTotal.TabIndex = 5

        '

        'lblTax

        '

        Me.lblTax.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D

        Me.lblTax.Location = New System.Drawing.Point(136, 48)

        Me.lblTax.Name = "lblTax"

        Me.lblTax.TabIndex = 4

        '

        'lblSubTotal

        '

        Me.lblSubTotal.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D

        Me.lblSubTotal.Location = New System.Drawing.Point(136, 24)

        Me.lblSubTotal.Name = "lblSubTotal"

        Me.lblSubTotal.TabIndex = 3

        '

        'Label5

        '

        Me.Label5.Location = New System.Drawing.Point(32, 80)

        Me.Label5.Name = "Label5"

        Me.Label5.TabIndex = 2

        Me.Label5.Text = "Total Due"

        '

        'Label4

        '

        Me.Label4.Location = New System.Drawing.Point(32, 56)

        Me.Label4.Name = "Label4"

        Me.Label4.TabIndex = 1

        Me.Label4.Text = "Tax (if Citizen)"

        '

        'Label3

        '

        Me.Label3.Location = New System.Drawing.Point(32, 32)

        Me.Label3.Name = "Label3"

        Me.Label3.TabIndex = 0

        Me.Label3.Text = "SubTotal"

        '

        'MainMenu1

        '

        Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuFile, Me.mnuEdit, Me.mnuHelp})

        '

        'mnuFile

        '

        Me.mnuFile.Index = 0

        Me.mnuFile.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuFileNew, Me.mnuFileSummary, Me.mnuFileExit})

        Me.mnuFile.Text = "&File"

        '

        'mnuFileNew

        '

        Me.mnuFileNew.Index = 0

        Me.mnuFileNew.Text = "&New Order"

        '

        'mnuFileSummary

        '

        Me.mnuFileSummary.Index = 1

        Me.mnuFileSummary.Text = "&Summary"

        '

        'mnuFileExit

        '

        Me.mnuFileExit.Index = 2

        Me.mnuFileExit.Text = "E&xit"

        '

        'mnuEdit

        '

        Me.mnuEdit.Index = 1

        Me.mnuEdit.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuEditCalc, Me.mnuEditClear, Me.mnuEditFont, Me.mnuEditColor})

        Me.mnuEdit.Text = "&Edit"

        '

        'mnuEditCalc

        '

        Me.mnuEditCalc.Index = 0

        Me.mnuEditCalc.Text = "Calculate &Selection"

        '

        'mnuEditClear

        '

        Me.mnuEditClear.Index = 1

        Me.mnuEditClear.Text = "C&lear Item"

        '

        'mnuEditFont

        '

        Me.mnuEditFont.Index = 2

        Me.mnuEditFont.Text = "&Font"

        '

        'mnuEditColor

        '

        Me.mnuEditColor.Index = 3

        Me.mnuEditColor.Text = "&Color"

        '

        'mnuHelp

        '

        Me.mnuHelp.Index = 2

        Me.mnuHelp.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuHelpAbout})

        Me.mnuHelp.Text = "&Help"

        '

        'mnuHelpAbout

        '

        Me.mnuHelpAbout.Index = 0

        Me.mnuHelpAbout.Text = "&About"

        '

        'picTrain

        '

        Me.picTrain.Image = CType(resources.GetObject("picTrain.Image"), System.Drawing.Image)

        Me.picTrain.Location = New System.Drawing.Point(296, 208)

        Me.picTrain.Name = "picTrain"

        Me.picTrain.Size = New System.Drawing.Size(256, 136)

        Me.picTrain.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage

        Me.picTrain.TabIndex = 2

        Me.picTrain.TabStop = False

        '

        'frmTransportation

        '

        Me.AcceptButton = Me.btnCalculate

        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

        Me.CancelButton = Me.btnClear

        Me.ClientSize = New System.Drawing.Size(560, 350)

        Me.Controls.Add(Me.picTrain)

        Me.Controls.Add(Me.GroupBox3)

        Me.Controls.Add(Me.GroupBox1)

        Me.Menu = Me.MainMenu1

        Me.Name = "frmTransportation"

        Me.Text = "Georgia Train Departure"

        Me.GroupBox1.ResumeLayout(False)

        Me.GroupBox2.ResumeLayout(False)

        Me.GroupBox3.ResumeLayout(False)

        Me.ResumeLayout(False)

 

    End Sub

 

#End Region

 

    Dim mdecSubTotal As Decimal

    Dim mdecTotal As Decimal

    Dim mdecGrandTotal As Decimal

    Dim mintCustomerCount As Integer

    Const mdecTAX_RATE As Decimal = 0.08D

    Const mdecATLANTA_PRICE As Decimal = 25D

    Const mdecSAVANNAH_PRICE As Decimal = 150D

    Const mdecVALDOSTA_PRICE As Decimal = 100D

    Const mdecDOWNTOWN_PRICE As Decimal = 75D

 

    Private Sub btnCalculate_Click(ByVal sender As System.Object, _

     ByVal e As System.EventArgs) Handles btnCalculate.Click

        'Calculate and display the current amounts, add to totals

 

        Dim decPrice As Decimal

        Dim intPassangers As Integer

        Dim decTax As Decimal

        Dim decItemAmount As Decimal

        Dim strMessage As String

 

        'Find the price

        If radAtlanta.Checked Then

            decPrice = mdecATLANTA_PRICE

        ElseIf radSavannah.Checked Then

            decPrice = mdecSAVANNAH_PRICE

        ElseIf radValdosta.Checked Then

            decPrice = mdecVALDOSTA_PRICE

        ElseIf radDowntownAtlanta.Checked Or radDowntownSavannah.Checked Then

            decPrice = mdecDOWNTOWN_PRICE

        Else

            MessageBox.Show("Please make a destination selection", "Selection Required", _

             MessageBoxButtons.OK, MessageBoxIcon.Information)

        End If

 

        'Calculate extended price and add to order total

        If txtPassangers.Text <> "" Then 'Not blank

            If IsNumeric(txtPassangers.Text) Then 'Is Numeric

                'Good Data - perform calculations

                Try

                    intPassangers = CInt(txtPassangers.Text)

                    decItemAmount = decPrice * intPassangers

                    mdecSubTotal += decItemAmount

                    If chkTax.Checked Then

                        decTax = mdecSubTotal * mdecTAX_RATE

                    Else

                        decTax = 0

                    End If

                    mdecTotal = mdecSubTotal + decTax

                    lblItemAmount.Text = FormatCurrency(decItemAmount)

                    lblSubTotal.Text = FormatNumber(mdecSubTotal)

                    lblTax.Text = FormatCurrency(decTax)

                    lblTotal.Text = FormatCurrency(mdecTotal)

                    chkTax.Enabled = False     'Allow change for new order only

                    btnClear.Enabled = True    'Allow Clear after an order has begun

                Catch

                    strMessage = "Calculation error."

                    MessageBox.Show(strMessage, "Error", _

                     MessageBoxButtons.OK, MessageBoxIcon.Information)

                End Try

            Else 'Nonnumeric data

                strMessage = "Nonnumeric data entered for passangers."

                MessageBox.Show(strMessage, "Data entry error", _

                 MessageBoxButtons.OK, MessageBoxIcon.Information)

                txtPassangers.Focus()

            End If

        Else 'Missing data

            strMessage = "Enter the passanger amount."

            MessageBox.Show(strMessage, "Data entry error", _

             MessageBoxButtons.OK, MessageBoxIcon.Information)

            txtPassangers.Focus()

        End If

    End Sub

 

    Private Sub btnClear_Click(ByVal sender As System.Object, _

     ByVal e As System.EventArgs) Handles btnClear.Click

        ' Clear appropriate controls

 

        radAtlanta.Checked = True

        lblItemAmount.Text = ""

        With txtPassangers

            .Clear()

            .Focus()

        End With

    End Sub

 

    Private Sub mnuFileNew_Click(ByVal sender As System.Object, _

     ByVal e As System.EventArgs) Handles mnuFileNew.Click

        'Clear the current order and add to totals

 

        Dim dgrResult As DialogResult

        Dim strMessage As String

 

        'Confirm clear of current order

        strMessage = "Clear the current customer figures?"

        dgrResult = MessageBox.Show(strMessage, "Clear Order", _

         MessageBoxButtons.YesNo, MessageBoxIcon.Question, _

          MessageBoxDefaultButton.Button2)

 

        If dgrResult = DialogResult.Yes Then 'User said Yes

            btnClear_Click(sender, e)        'Clear the screen fields

            lblSubTotal.Text = ""

            lblTax.Text = ""

            lblTotal.Text = ""

 

            Try

                'Add to Totals

                If mdecSubTotal <> 0 Then 'Should not be able to add to counts if no

                    'new order/customer. Prevents accidental clicking.

                    mdecGrandTotal += mdecTotal

                    mintCustomerCount += 1

                    mdecSubTotal = 0

                    mdecTotal = 0       'Reset for next cutomer

                End If

            Catch

                strMessage = "Error in calculations."

                MessageBox.Show(strMessage, "Error", MessageBoxButtons.OK, _

                 MessageBoxIcon.Error)

            End Try

 

            'Clear appropriate display items and enable check box

            With chkTax

                .Enabled = True

                .Checked = False

            End With

            btnClear.Enabled = False

        End If

    End Sub

 

    Private Sub mnuFileSummary_Click(ByVal sender As System.Object, _

     ByVal e As System.EventArgs) Handles mnuFileSummary.Click

        'Calculate the average and display the totals

 

        Dim decAverage As Decimal

        Dim strMessageString As String

 

        If mdecTotal <> 0 Then

            'Make sure last order is counted

            mnuFileNew_Click(sender, e)   'Pass incoming arguments to called procedure

        End If

 

        If mintCustomerCount > 0 Then

            Try

                'Calculate Average

                decAverage = mdecGrandTotal / mintCustomerCount

 

                'Concatenate the message string

                strMessageString = "Number of Orders: " & CStr(mintCustomerCount) _

                 & ControlChars.NewLine & ControlChars.NewLine _

                 & "Total Sales: " & FormatCurrency(mdecGrandTotal) _

                 & ControlChars.NewLine & ControlChars.NewLine _

                 & "Average Sale: " & FormatCurrency(decAverage)

                MessageBox.Show(strMessageString, "Ticket Sales Summary", _

                 MessageBoxButtons.OK, MessageBoxIcon.Information)

            Catch

                strMessageString = "Error in calculations."

                MessageBox.Show(strMessageString, "Error", MessageBoxButtons.OK, _

                 MessageBoxIcon.Error)

            End Try

        Else

            strMessageString = "No sales data to summarize."

            MessageBox.Show(strMessageString, "Ticket Sales Summary", _

             MessageBoxButtons.OK, MessageBoxIcon.Information)

        End If

    End Sub

 

    Private Sub mnuFileExit_Click(ByVal sender As System.Object, _

     ByVal e As System.EventArgs) Handles mnuFileExit.Click

        'Terminate the procedure

 

        Me.Close()

    End Sub

 

    Private Sub mnuEditCalc_Click(ByVal sender As System.Object, _

     ByVal e As System.EventArgs) Handles mnuEditCalc.Click

        'Call the Calculate event procedure

 

        btnCalculate_Click(sender, e)    'Pass incoming arguments to called procedure

    End Sub

 

    Private Sub mnuEditClear_Click(ByVal sender As System.Object, _

     ByVal e As System.EventArgs) Handles mnuEditClear.Click

        'Call the Clear event procedure

 

        btnClear_Click(sender, e)    'Pass incoming arguments to called procedure

    End Sub

 

    Private Sub mnuEditFont_Click(ByVal sender As System.Object, _

     ByVal e As System.EventArgs) Handles mnuEditFont.Click

        'Allow the user to select a new font for the summary totals

 

        With dlgFont

            .Font = lblSubTotal.Font

            .ShowDialog()

            lblSubTotal.Font = .Font

            lblTax.Font = .Font

            lblTotal.Font = .Font

        End With

    End Sub

 

    Private Sub mnuEditColor_Click(ByVal sender As System.Object, _

     ByVal e As System.EventArgs) Handles mnuEditColor.Click

        'Allow the user to select a new color for the summary totals

 

        With dlgColor

            .Color = lblSubTotal.ForeColor

            .ShowDialog()

            lblSubTotal.ForeColor = .Color

            lblTax.ForeColor = .Color

            lblTotal.ForeColor = .Color

        End With

    End Sub

 

    Private Sub mnuHelpAbout_Click(ByVal sender As Object, _

     ByVal e As System.EventArgs) Handles mnuHelpAbout.Click

        'Display the About message box

        Dim strMessage As String

 

        strMessage = "Georgia Train Departure" & ControlChars.NewLine & ControlChars.NewLine _

         & "Programmed by Bradley Shedd"

 

        MessageBox.Show(strMessage, "About Georgia Train Departure", MessageBoxButtons.OK, _

         MessageBoxIcon.Information)

    End Sub

 

    Private Function FindTax(ByVal decAmount As Decimal) As Decimal

        'Calculate the sales tax

 

        Return decAmount * mdecTAX_RATE

    End Function

End Class

 

 

 

Homepage