C Starting out with visual x C chegg study IGuided s x G what\'s on a wendy\'s b
ID: 3838709 • Letter: C
Question
C Starting out with visual x C chegg study IGuided s x G what's on a wendy's b My Grades -17SP CIT. x y Cloud Photo C Apple Inc. (US https://www.icloud com photos2 May 12, 2017 2:10:32 PM Cloud Photos E 25 of 35 2. Shopping as system. The user should be able Design an application that works a her shopping cart: to add any of the following items to his or Photos Albums All Photos Print Books (books on paper d Videos $11.95 I Did It Your Way $14.50 Screenshots The History of Scotland $29.95 t Recently Deleted Learn in One Day Calculus $18.50 Feel the Stress What SApp Audio Books (books on tape): $29.95 Learn Calculus in One Day $14.50 The History of Scotland $12.95 The Science of Body Language $11.50 Relaxation Techniques shown in Figure 7.65. The application's main form should appear similar to the one Figure 7-65 Shopping Cart main form Products Selected D Joshua v 3:00 PM 5/122017Explanation / Answer
frm_About.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frm_About
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
Friend WithEvents TableLayoutPanel As System.Windows.Forms.TableLayoutPanel
Friend WithEvents LogoPictureBox As System.Windows.Forms.PictureBox
Friend WithEvents LabelProductName As System.Windows.Forms.Label
Friend WithEvents LabelVersion As System.Windows.Forms.Label
Friend WithEvents LabelCompanyName As System.Windows.Forms.Label
Friend WithEvents About As System.Windows.Forms.TextBox
Friend WithEvents OKButton As System.Windows.Forms.Button
Friend WithEvents LabelCopyright As System.Windows.Forms.Label
Private components As System.ComponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frm_About))
Me.TableLayoutPanel = New System.Windows.Forms.TableLayoutPanel()
Me.LogoPictureBox = New System.Windows.Forms.PictureBox()
Me.LabelProductName = New System.Windows.Forms.Label()
Me.LabelVersion = New System.Windows.Forms.Label()
Me.LabelCopyright = New System.Windows.Forms.Label()
Me.LabelCompanyName = New System.Windows.Forms.Label()
Me.About = New System.Windows.Forms.TextBox()
Me.OKButton = New System.Windows.Forms.Button()
Me.TableLayoutPanel.SuspendLayout()
CType(Me.LogoPictureBox, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
Me.TableLayoutPanel.ColumnCount = 2
Me.TableLayoutPanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.0!))
Me.TableLayoutPanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 67.0!))
Me.TableLayoutPanel.Controls.Add(Me.LogoPictureBox, 0, 0)
Me.TableLayoutPanel.Controls.Add(Me.LabelProductName, 1, 0)
Me.TableLayoutPanel.Controls.Add(Me.LabelVersion, 1, 1)
Me.TableLayoutPanel.Controls.Add(Me.LabelCopyright, 1, 2)
Me.TableLayoutPanel.Controls.Add(Me.LabelCompanyName, 1, 3)
Me.TableLayoutPanel.Controls.Add(Me.About, 1, 4)
Me.TableLayoutPanel.Controls.Add(Me.OKButton, 1, 5)
Me.TableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill
Me.TableLayoutPanel.Location = New System.Drawing.Point(9, 9)
Me.TableLayoutPanel.Name = "TableLayoutPanel"
Me.TableLayoutPanel.RowCount = 6
Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!))
Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!))
Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!))
Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!))
Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!))
Me.TableLayoutPanel.Size = New System.Drawing.Size(396, 258)
Me.TableLayoutPanel.TabIndex = 0
Me.LogoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill
Me.LogoPictureBox.Image = CType(resources.GetObject("LogoPictureBox.Image"), System.Drawing.Image)
Me.LogoPictureBox.Location = New System.Drawing.Point(3, 3)
Me.LogoPictureBox.Name = "LogoPictureBox"
Me.TableLayoutPanel.SetRowSpan(Me.LogoPictureBox, 6)
Me.LogoPictureBox.Size = New System.Drawing.Size(124, 252)
Me.LogoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.LogoPictureBox.TabIndex = 0
Me.LogoPictureBox.TabStop = False
Me.LabelProductName.Dock = System.Windows.Forms.DockStyle.Fill
Me.LabelProductName.Location = New System.Drawing.Point(136, 0)
Me.LabelProductName.Margin = New System.Windows.Forms.Padding(6, 0, 3, 0)
Me.LabelProductName.MaximumSize = New System.Drawing.Size(0, 17)
Me.LabelProductName.Name = "LabelProductName"
Me.LabelProductName.Size = New System.Drawing.Size(257, 17)
Me.LabelProductName.TabIndex = 0
Me.LabelProductName.Text = "Program: Shopping Cart"
Me.LabelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.LabelVersion.Dock = System.Windows.Forms.DockStyle.Fill
Me.LabelVersion.Location = New System.Drawing.Point(136, 25)
Me.LabelVersion.Margin = New System.Windows.Forms.Padding(6, 0, 3, 0)
Me.LabelVersion.MaximumSize = New System.Drawing.Size(0, 17)
Me.LabelVersion.Name = "LabelVersion"
Me.LabelVersion.Size = New System.Drawing.Size(257, 17)
Me.LabelVersion.TabIndex = 0
Me.LabelVersion.Text = "Version: 1.0"
Me.LabelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.LabelCopyright.Dock = System.Windows.Forms.DockStyle.Fill
Me.LabelCopyright.Location = New System.Drawing.Point(136, 50)
Me.LabelCopyright.Margin = New System.Windows.Forms.Padding(6, 0, 3, 0)
Me.LabelCopyright.MaximumSize = New System.Drawing.Size(0, 17)
Me.LabelCopyright.Name = "LabelCopyright"
Me.LabelCopyright.Size = New System.Drawing.Size(257, 17)
Me.LabelCopyright.TabIndex = 0
Me.LabelCopyright.Text = "Copyright "
Me.LabelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.LabelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill
Me.LabelCompanyName.Location = New System.Drawing.Point(136, 75)
Me.LabelCompanyName.Margin = New System.Windows.Forms.Padding(6, 0, 3, 0)
Me.LabelCompanyName.MaximumSize = New System.Drawing.Size(0, 17)
Me.LabelCompanyName.Name = "LabelCompanyName"
Me.LabelCompanyName.Size = New System.Drawing.Size(257, 17)
Me.LabelCompanyName.TabIndex = 0
Me.LabelCompanyName.Text = "Designed and Developed by Tyler Hunt"
Me.LabelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.About.Dock = System.Windows.Forms.DockStyle.Fill
Me.About.Location = New System.Drawing.Point(136, 103)
Me.About.Margin = New System.Windows.Forms.Padding(6, 3, 3, 3)
Me.About.Multiline = True
Me.About.Name = "About"
Me.About.ReadOnly = True
Me.About.ScrollBars = System.Windows.Forms.ScrollBars.Both
Me.About.Size = New System.Drawing.Size(257, 123)
Me.About.TabIndex = 0
Me.About.TabStop = False
Me.About.Text = "Description :" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Chapter 7 Multiple Forms, Modules, and Menus" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10)
Me.OKButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.OKButton.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.OKButton.Location = New System.Drawing.Point(318, 234)
Me.OKButton.Name = "OKButton"
Me.OKButton.Size = New System.Drawing.Size(75, 21)
Me.OKButton.TabIndex = 0
Me.OKButton.Text = "&OK"
Me.AcceptButton = Me.OKButton
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.OKButton
Me.ClientSize = New System.Drawing.Size(414, 276)
Me.Controls.Add(Me.TableLayoutPanel)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frm_About"
Me.Padding = New System.Windows.Forms.Padding(9, 9, 9, 9)
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "About"
Me.TableLayoutPanel.ResumeLayout(False)
Me.TableLayoutPanel.PerformLayout()
CType(Me.LogoPictureBox, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
End Class
frm_About.vb
Public NotInheritable Class frm_About
Private Sub frm_About_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Set the title of the form.
Dim ApplicationTitle As String
If My.Application.Info.Title <> "" Then
ApplicationTitle = My.Application.Info.Title
Else
ApplicationTitle = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
End If
Me.Text = String.Format("About {0}", ApplicationTitle)
Me.LabelProductName.Text = My.Application.Info.ProductName
Me.LabelVersion.Text = String.Format("Version {0}", My.Application.Info.Version.ToString)
Me.LabelCopyright.Text = My.Application.Info.Copyright
Me.LabelCompanyName.Text = My.Application.Info.CompanyName
Me.About.Text = My.Application.Info.Description
End Sub
Private Sub OKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKButton.Click
Me.Close()
End Sub
Private Sub LabelProductName_Click(sender As Object, e As EventArgs) Handles LabelProductName.Click
End Sub
End Class
frm_AudioBooks.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frm_AudioBooks
Inherits System.Windows.Forms.Form
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
Private components As System.ComponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.btn_AudioFrmClose_Sub = New System.Windows.Forms.Button()
Me.btn_AddAudioBook_Sub = New System.Windows.Forms.Button()
Me.gb_AudioBooks_Sub = New System.Windows.Forms.GroupBox()
Me.lb_AudioBookItems_Sub = New System.Windows.Forms.ListBox()
Me.gb_AudioBooks_Sub.SuspendLayout()
Me.SuspendLayout()
Me.btn_AudioFrmClose_Sub.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btn_AudioFrmClose_Sub.Location = New System.Drawing.Point(192, 197)
Me.btn_AudioFrmClose_Sub.Margin = New System.Windows.Forms.Padding(2)
Me.btn_AudioFrmClose_Sub.Name = "btn_AudioFrmClose_Sub"
Me.btn_AudioFrmClose_Sub.Size = New System.Drawing.Size(105, 35)
Me.btn_AudioFrmClose_Sub.TabIndex = 5
Me.btn_AudioFrmClose_Sub.Text = "Close"
Me.btn_AudioFrmClose_Sub.UseVisualStyleBackColor = True
Me.btn_AddAudioBook_Sub.Location = New System.Drawing.Point(16, 197)
Me.btn_AddAudioBook_Sub.Margin = New System.Windows.Forms.Padding(2)
Me.btn_AddAudioBook_Sub.Name = "btn_AddAudioBook_Sub"
Me.btn_AddAudioBook_Sub.Size = New System.Drawing.Size(108, 35)
Me.btn_AddAudioBook_Sub.TabIndex = 4
Me.btn_AddAudioBook_Sub.Text = "Add Book to Cart"
Me.btn_AddAudioBook_Sub.UseVisualStyleBackColor = True
Me.gb_AudioBooks_Sub.Controls.Add(Me.lb_AudioBookItems_Sub)
Me.gb_AudioBooks_Sub.Location = New System.Drawing.Point(16, 18)
Me.gb_AudioBooks_Sub.Margin = New System.Windows.Forms.Padding(2)
Me.gb_AudioBooks_Sub.Name = "gb_AudioBooks_Sub"
Me.gb_AudioBooks_Sub.Padding = New System.Windows.Forms.Padding(2)
Me.gb_AudioBooks_Sub.Size = New System.Drawing.Size(282, 167)
Me.gb_AudioBooks_Sub.TabIndex = 3
Me.gb_AudioBooks_Sub.TabStop = False
Me.gb_AudioBooks_Sub.Text = "Select an Audio Book"
Me.lb_AudioBookItems_Sub.FormattingEnabled = True
Me.lb_AudioBookItems_Sub.Items.AddRange(New Object() {"Learn Calculus in One Day $29.95", "The History of Scottland $14.50", "The Science of Body Language $12.95", "Relaxation Techniques $11.50"})
Me.lb_AudioBookItems_Sub.Location = New System.Drawing.Point(11, 22)
Me.lb_AudioBookItems_Sub.Margin = New System.Windows.Forms.Padding(2)
Me.lb_AudioBookItems_Sub.Name = "lb_AudioBookItems_Sub"
Me.lb_AudioBookItems_Sub.Size = New System.Drawing.Size(261, 134)
Me.lb_AudioBookItems_Sub.TabIndex = 0
Me.AcceptButton = Me.btn_AddAudioBook_Sub
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.btn_AudioFrmClose_Sub
Me.ClientSize = New System.Drawing.Size(317, 266)
Me.Controls.Add(Me.btn_AudioFrmClose_Sub)
Me.Controls.Add(Me.btn_AddAudioBook_Sub)
Me.Controls.Add(Me.gb_AudioBooks_Sub)
Me.Margin = New System.Windows.Forms.Padding(2)
Me.MaximumSize = New System.Drawing.Size(333, 304)
Me.MinimumSize = New System.Drawing.Size(333, 304)
Me.Name = "frm_AudioBooks"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Audio Books"
Me.gb_AudioBooks_Sub.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
Friend WithEvents btn_AudioFrmClose_Sub As Button
Friend WithEvents btn_AddAudioBook_Sub As Button
Friend WithEvents gb_AudioBooks_Sub As GroupBox
Friend WithEvents lb_AudioBookItems_Sub As ListBox
End Class
frm_Main.vb
Public Class frm_Main
'Menu Event to show about form
Private Sub AboutToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AboutToolStripMenuItem.Click
frm_About.ShowDialog()
End Sub
'Menu Event to show printBooks form
Private Sub PrintBooksToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PrintBooksToolStripMenuItem.Click
frm_PrintBooks.Show()
End Sub
'Menu Event to show AudioBooks form
Private Sub AudioBooksToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AudioBooksToolStripMenuItem.Click
frm_AudioBooks.ShowDialog()
End Sub
'Form Event to remove selected items
Private Sub btn_Remove_Click(sender As Object, e As EventArgs) Handles btn_Remove.Click
Dim selectedIndex As Single = lb_SelectedList.SelectedIndex
If selectedIndex >= 0 Then
removeSelectedItem()
Else
MessageBox.Show("Sorry, You must select a value from the list!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand)
End If
End Sub
'Method to remove selected items from main Listbox <<<<<<<------/////////// TODO: Need to work on the delete order
Sub removeSelectedItem()
Dim itemIndex As Integer = My.Forms.frm_Main.lb_SelectedList.SelectedIndex
'Remove selected item from listBox in main form
lb_SelectedList.Items.RemoveAt(itemIndex)
'Remove selected item from List
gLst_SelectCostList.RemoveAt(itemIndex)
'Reset global item count
gSng_SelectedItemCount = -1
'Update main form cost summary
updateCostSummary()
End Sub
'Menu Event to reset form
Private Sub ResetCtrlRToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ResetCtrlRToolStripMenuItem.Click
resetForm()
End Sub
'Form Event to close form
Private Sub ExitCtrlQToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExitCtrlQToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim test As String
For Each num In gLst_SelectCostList
test += num & vbNewLine
Next
MsgBox(test)
End Sub
End Class
frm_PrintBooks.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frm_PrintBooks
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.gb_PrintBooks_Sub = New System.Windows.Forms.GroupBox()
Me.lb_PrintBookItems_Sub = New System.Windows.Forms.ListBox()
Me.btn_AddPrintBook_Sub = New System.Windows.Forms.Button()
Me.btn_PrintFrmClose_Sub = New System.Windows.Forms.Button()
Me.gb_PrintBooks_Sub.SuspendLayout()
Me.SuspendLayout()
Me.gb_PrintBooks_Sub.Controls.Add(Me.lb_PrintBookItems_Sub)
Me.gb_PrintBooks_Sub.Location = New System.Drawing.Point(14, 22)
Me.gb_PrintBooks_Sub.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.gb_PrintBooks_Sub.Name = "gb_PrintBooks_Sub"
Me.gb_PrintBooks_Sub.Padding = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.gb_PrintBooks_Sub.Size = New System.Drawing.Size(284, 167)
Me.gb_PrintBooks_Sub.TabIndex = 0
Me.gb_PrintBooks_Sub.TabStop = False
Me.gb_PrintBooks_Sub.Text = "Select a Print Book"
Me.lb_PrintBookItems_Sub.FormattingEnabled = True
Me.lb_PrintBookItems_Sub.Items.AddRange(New Object() {"I Did It Your Way $11.95", "The History of Scottland $14.50", "Learn Calculus in One Day $29.50", "Feel the Stress $18.50"})
Me.lb_PrintBookItems_Sub.Location = New System.Drawing.Point(11, 22)
Me.lb_PrintBookItems_Sub.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.lb_PrintBookItems_Sub.Name = "lb_PrintBookItems_Sub"
Me.lb_PrintBookItems_Sub.Size = New System.Drawing.Size(266, 134)
Me.lb_PrintBookItems_Sub.TabIndex = 0
Me.btn_AddPrintBook_Sub.Location = New System.Drawing.Point(14, 202)
Me.btn_AddPrintBook_Sub.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.btn_AddPrintBook_Sub.Name = "btn_AddPrintBook_Sub"
Me.btn_AddPrintBook_Sub.Size = New System.Drawing.Size(100, 35)
Me.btn_AddPrintBook_Sub.TabIndex = 1
Me.btn_AddPrintBook_Sub.Text = "Add Book to Cart"
Me.btn_AddPrintBook_Sub.UseVisualStyleBackColor = True
Me.btn_PrintFrmClose_Sub.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btn_PrintFrmClose_Sub.Location = New System.Drawing.Point(198, 202)
Me.btn_PrintFrmClose_Sub.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.btn_PrintFrmClose_Sub.Name = "btn_PrintFrmClose_Sub"
Me.btn_PrintFrmClose_Sub.Size = New System.Drawing.Size(100, 35)
Me.btn_PrintFrmClose_Sub.TabIndex = 2
Me.btn_PrintFrmClose_Sub.Text = "Close"
Me.btn_PrintFrmClose_Sub.UseVisualStyleBackColor = True
Me.AcceptButton = Me.btn_AddPrintBook_Sub
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.btn_PrintFrmClose_Sub
Me.ClientSize = New System.Drawing.Size(317, 266)
Me.Controls.Add(Me.btn_PrintFrmClose_Sub)
Me.Controls.Add(Me.btn_AddPrintBook_Sub)
Me.Controls.Add(Me.gb_PrintBooks_Sub)
Me.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.MaximumSize = New System.Drawing.Size(333, 304)
Me.MinimumSize = New System.Drawing.Size(333, 304)
Me.Name = "frm_PrintBooks"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Print Books"
Me.gb_PrintBooks_Sub.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
Friend WithEvents gb_PrintBooks_Sub As GroupBox
Friend WithEvents lb_PrintBookItems_Sub As ListBox
Friend WithEvents btn_AddPrintBook_Sub As Button
Friend WithEvents btn_PrintFrmClose_Sub As Button
End Class
mdl_ShoppingCart.vb
Module mdl_ShoppingCart
'Constant for Tax rate and shipping cost
Public Const gDec_TAXRATE As Decimal = 0.06D
Public Const gDEC_SHIPPINGCHARGES As Decimal = 2D
Public gSng_SelectedItemCount As Single = 0S '?????? not sure if needed
'Constants for each respective book
Public Const gDEC_Book0 As Decimal = 11.95D
Public Const gDEC_Book1 As Decimal = 14.5D
Public Const gDEC_Book2 As Decimal = 29.95D
Public Const gDEC_Book3 As Decimal = 18.5D
Public Const gDEC_Book4 As Decimal = 29.95D
Public Const gDEC_Book5 As Decimal = 14.5D
Public Const gDEC_Book6 As Decimal = 12.95D
Public Const gDEC_Book7 As Decimal = 11.5D
'Array to hold the book prices
Public gDec_PricesArray As Decimal() = {gDEC_Book0, gDEC_Book1, gDEC_Book2, gDEC_Book3,
gDEC_Book4, gDEC_Book5, gDEC_Book6, gDEC_Book7}
Public gLst_SelectCostList As New List(Of Decimal)()
Sub updateCostSummary()
'Declare local variables
Dim subTotal As Decimal = 0D
Dim taxTotal As Decimal = 0D
Dim count As Single = 0S
Dim shippingCostTotal As Decimal = 0D
Dim finalTotal As Decimal = 0D
'Loop thru selected costs and Sum the value
For Each num In gLst_SelectCostList
subTotal += num
gSng_SelectedItemCount += 1 'TODO: not sure if this is needed or not will test
count += 1
Next
'Add string to the Subtotal txtbox
My.Forms.frm_Main.txt_SubTotal.Text = subTotal.ToString("c2") 'TODO: Test why the remove function is not working properly
'Calc tax and Add string to the Tax txtBox
taxTotal = subTotal * gDec_TAXRATE
My.Forms.frm_Main.txt_Tax.Text = taxTotal.ToString("c2")
'Calc shipping costS and place in shipping txtbox
shippingCostTotal = CDec(count) * gDEC_SHIPPINGCHARGES
My.Forms.frm_Main.txt_Shipping.Text = shippingCostTotal.ToString("c2")
'Calc total costs and plac in total txtbox
finalTotal = subTotal + taxTotal + shippingCostTotal
My.Forms.frm_Main.txt_Total.Text = finalTotal.ToString("c2")
End Sub
'Method to reset the form and all other values
Sub resetForm()
'Clear main form values
frm_Main.txt_SubTotal.Text = String.Empty
frm_Main.txt_Tax.Text = String.Empty
frm_Main.txt_Shipping.Text = String.Empty
frm_Main.txt_Total.Text = String.Empty
'Clear selected List
gLst_SelectCostList.Clear()
'Clear select listbox values
My.Forms.frm_Main.lb_SelectedList.Items.Clear()
End Sub
End Module
note: due to limited data i cant able to upload theae two files
frm_PrintBooks.vb
frm_AudioBooks.vb
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.