Visual Basic

profileqboirtteu984
unitv_studentfiles.zip

Chap08/AddSub Solution/AddSub Project/AddSub Project.vbproj

Debug AnyCPU {D08A9C30-27D1-40C7-ABB6-E73A9B72D3CF} WinExe AddSub_Project.My.MyApplication AddSub_Project AddSub Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ AddSub Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ AddSub Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap08/AddSub Solution/AddSub Project/App.config

Chap08/AddSub Solution/AddSub Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Public Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing AndAlso components IsNot Nothing Then components.Dispose() 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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.lblAnswer = New System.Windows.Forms.Label() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.txtNum1 = New System.Windows.Forms.TextBox() Me.txtNum2 = New System.Windows.Forms.TextBox() Me.Label3 = New System.Windows.Forms.Label() Me.chkSubtract = New System.Windows.Forms.CheckBox() Me.PictureBox1 = New System.Windows.Forms.PictureBox() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(151, 75) Me.Label1.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(70, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "Number &1:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(151, 110) Me.Label2.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(70, 17) Me.Label2.TabIndex = 2 Me.Label2.Text = "Number &2:" ' 'lblAnswer ' Me.lblAnswer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblAnswer.Location = New System.Drawing.Point(208, 146) Me.lblAnswer.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.lblAnswer.Name = "lblAnswer" Me.lblAnswer.Size = New System.Drawing.Size(52, 33) Me.lblAnswer.TabIndex = 8 Me.lblAnswer.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(276, 110) Me.btnCalc.Margin = New System.Windows.Forms.Padding(2) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(96, 32) Me.btnCalc.TabIndex = 4 Me.btnCalc.Text = "&Calculate" ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(276, 147) Me.btnExit.Margin = New System.Windows.Forms.Padding(2) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(96, 32) Me.btnExit.TabIndex = 6 Me.btnExit.Text = "E&xit" ' 'txtNum1 ' Me.txtNum1.Location = New System.Drawing.Point(220, 71) Me.txtNum1.Margin = New System.Windows.Forms.Padding(2) Me.txtNum1.Name = "txtNum1" Me.txtNum1.Size = New System.Drawing.Size(37, 25) Me.txtNum1.TabIndex = 1 ' 'txtNum2 ' Me.txtNum2.Location = New System.Drawing.Point(220, 106) Me.txtNum2.Margin = New System.Windows.Forms.Padding(2) Me.txtNum2.Name = "txtNum2" Me.txtNum2.Size = New System.Drawing.Size(37, 25) Me.txtNum2.TabIndex = 3 ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(151, 155) Me.Label3.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(53, 17) Me.Label3.TabIndex = 7 Me.Label3.Text = "Answer:" ' 'chkSubtract ' Me.chkSubtract.AutoSize = True Me.chkSubtract.Location = New System.Drawing.Point(151, 28) Me.chkSubtract.Name = "chkSubtract" Me.chkSubtract.Size = New System.Drawing.Size(93, 21) Me.chkSubtract.TabIndex = 5 Me.chkSubtract.Text = "&Subtraction" Me.chkSubtract.UseVisualStyleBackColor = True ' 'PictureBox1 ' Me.PictureBox1.Image = Global.AddSub_Project.My.Resources.Resources.Calculator Me.PictureBox1.Location = New System.Drawing.Point(21, 12) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(104, 175) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 9 Me.PictureBox1.TabStop = False ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(394, 199) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.chkSubtract) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.txtNum2) Me.Controls.Add(Me.txtNum1) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblAnswer) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Addition and Subtraction Calculator" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents lblAnswer As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents txtNum1 As System.Windows.Forms.TextBox Friend WithEvents txtNum2 As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents chkSubtract As System.Windows.Forms.CheckBox Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox End Class

Chap08/AddSub Solution/AddSub Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True

Chap08/AddSub Solution/AddSub Project/frmMain.vb

' Name: AddSub Project ' Purpose: Display either the sum of or the difference ' between two numbers entered by the user ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub End Class

Chap08/AddSub Solution/AddSub Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.AddSub_Project.frmMain End Sub End Class End Namespace

Chap08/AddSub Solution/AddSub Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap08/AddSub Solution/AddSub Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("AddSub Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("AddSub Project")> <Assembly: AssemblyCopyright("Copyright © Toshiba 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("3aa5c44e-ff55-4208-811e-4a8f8f956391")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap08/AddSub Solution/AddSub Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("AddSub_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property Calculator() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Calculator", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace

Chap08/AddSub Solution/AddSub Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\Calculator.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Chap08/AddSub Solution/AddSub Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.AddSub_Project.My.MySettings Get Return Global.AddSub_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap08/AddSub Solution/AddSub Project/My Project/Settings.settings

Chap08/AddSub Solution/AddSub Project/Resources/Calculator.png

Chap08/AddSub Solution/AddSub Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "AddSub Project", "AddSub Project\AddSub Project.vbproj", "{D08A9C30-27D1-40C7-ABB6-E73A9B72D3CF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D08A9C30-27D1-40C7-ABB6-E73A9B72D3CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D08A9C30-27D1-40C7-ABB6-E73A9B72D3CF}.Debug|Any CPU.Build.0 = Debug|Any CPU {D08A9C30-27D1-40C7-ABB6-E73A9B72D3CF}.Release|Any CPU.ActiveCfg = Release|Any CPU {D08A9C30-27D1-40C7-ABB6-E73A9B72D3CF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap08/Bonus Solution/Bonus Project/App.config

Chap08/Bonus Solution/Bonus Project/Bonus Project.vbproj

Debug AnyCPU {C7613351-B956-4F0C-A33F-E6C601DDB850} WinExe Bonus_Project.My.MyApplication Bonus_Project Bonus Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Bonus Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Bonus Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap08/Bonus Solution/Bonus Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.lblBonus = New System.Windows.Forms.Label() Me.txtSales = New System.Windows.Forms.TextBox() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(32, 30) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(46, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Sales:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(32, 70) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(52, 20) Me.Label2.TabIndex = 4 Me.Label2.Text = "Bonus:" ' 'lblBonus ' Me.lblBonus.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblBonus.Location = New System.Drawing.Point(90, 67) Me.lblBonus.Name = "lblBonus" Me.lblBonus.Size = New System.Drawing.Size(90, 27) Me.lblBonus.TabIndex = 5 Me.lblBonus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'txtSales ' Me.txtSales.Location = New System.Drawing.Point(84, 27) Me.txtSales.Name = "txtSales" Me.txtSales.Size = New System.Drawing.Size(100, 27) Me.txtSales.TabIndex = 1 ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(212, 27) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(81, 30) Me.btnCalc.TabIndex = 2 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(212, 67) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(81, 30) Me.btnExit.TabIndex = 3 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(333, 141) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.txtSales) Me.Controls.Add(Me.lblBonus) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Bonus Calculator" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents lblBonus As System.Windows.Forms.Label Friend WithEvents txtSales As System.Windows.Forms.TextBox Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap08/Bonus Solution/Bonus Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True

Chap08/Bonus Solution/Bonus Project/frmMain.vb

' Name: Bonus Project ' Purpose: Display a bonus amount ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub End Class

Chap08/Bonus Solution/Bonus Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Bonus_Project.frmMain End Sub End Class End Namespace

Chap08/Bonus Solution/Bonus Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap08/Bonus Solution/Bonus Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Bonus Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Bonus Project")> <Assembly: AssemblyCopyright("Copyright © 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("3128713b-cb10-4766-a80c-2dc6d52a64aa")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap08/Bonus Solution/Bonus Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Bonus_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap08/Bonus Solution/Bonus Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap08/Bonus Solution/Bonus Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Bonus_Project.My.MySettings Get Return Global.Bonus_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap08/Bonus Solution/Bonus Project/My Project/Settings.settings

Chap08/Bonus Solution/Bonus Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Bonus Project", "Bonus Project\Bonus Project.vbproj", "{C7613351-B956-4F0C-A33F-E6C601DDB850}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {C7613351-B956-4F0C-A33F-E6C601DDB850}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C7613351-B956-4F0C-A33F-E6C601DDB850}.Debug|Any CPU.Build.0 = Debug|Any CPU {C7613351-B956-4F0C-A33F-E6C601DDB850}.Release|Any CPU.ActiveCfg = Release|Any CPU {C7613351-B956-4F0C-A33F-E6C601DDB850}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap08/ComputerHaven.png

Chap08/Exercise.png

Chap08/FigureThisOut Solution/FigureThisOut Project/App.config

Chap08/FigureThisOut Solution/FigureThisOut Project/FigureThisOut Project.vbproj

Debug AnyCPU {F856AEC8-3A6B-440E-BD79-C52658F3BCD3} WinExe FigureThisOut_Project.My.MyApplication FigureThisOut_Project FigureThisOut Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ FigureThisOut Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ FigureThisOut Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap08/FigureThisOut Solution/FigureThisOut Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.btnExit = New System.Windows.Forms.Button() Me.btnDisplay = New System.Windows.Forms.Button() Me.txtSecond = New System.Windows.Forms.TextBox() Me.txtFirst = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(144, 60) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(85, 29) Me.btnExit.TabIndex = 5 Me.btnExit.Text = "E&xit" ' 'btnDisplay ' Me.btnDisplay.Location = New System.Drawing.Point(144, 25) Me.btnDisplay.Name = "btnDisplay" Me.btnDisplay.Size = New System.Drawing.Size(85, 29) Me.btnDisplay.TabIndex = 4 Me.btnDisplay.Text = "&Display" ' 'txtSecond ' Me.txtSecond.Location = New System.Drawing.Point(25, 103) Me.txtSecond.Name = "txtSecond" Me.txtSecond.Size = New System.Drawing.Size(57, 25) Me.txtSecond.TabIndex = 3 ' 'txtFirst ' Me.txtFirst.Location = New System.Drawing.Point(24, 45) Me.txtFirst.Name = "txtFirst" Me.txtFirst.Size = New System.Drawing.Size(57, 25) Me.txtFirst.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(22, 83) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(103, 17) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Second number:" ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(21, 25) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(84, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "&First number:" ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(253, 159) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnDisplay) Me.Controls.Add(Me.txtSecond) Me.Controls.Add(Me.txtFirst) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Figure This Out" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnDisplay As System.Windows.Forms.Button Friend WithEvents txtSecond As System.Windows.Forms.TextBox Friend WithEvents txtFirst As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label1 As System.Windows.Forms.Label End Class

Chap08/FigureThisOut Solution/FigureThisOut Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True

Chap08/FigureThisOut Solution/FigureThisOut Project/frmMain.vb

' Name: FigureThisOut Project ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnDisplay_Click(sender As Object, e As EventArgs) Handles btnDisplay.Click Dim intNum1 As Integer Dim intNum2 As Integer Integer.TryParse(txtFirst.Text, intNum1) Integer.TryParse(txtSecond.Text, intNum2) If intNum1 > intNum2 Then Dim intTemp As Integer intTemp = intNum1 intNum1 = intNum2 intNum2 = intTemp txtFirst.Text = intNum1 txtSecond.Text = intNum2 End If End Sub End Class

Chap08/FigureThisOut Solution/FigureThisOut Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.FigureThisOut_Project.frmMain End Sub End Class End Namespace

Chap08/FigureThisOut Solution/FigureThisOut Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap08/FigureThisOut Solution/FigureThisOut Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("FigureThisOut Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("FigureThisOut Project")> <Assembly: AssemblyCopyright("Copyright © Toshiba 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("c1ddc8ac-d41e-4203-bfc8-7cbab2219580")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap08/FigureThisOut Solution/FigureThisOut Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("FigureThisOut_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap08/FigureThisOut Solution/FigureThisOut Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap08/FigureThisOut Solution/FigureThisOut Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.FigureThisOut_Project.My.MySettings Get Return Global.FigureThisOut_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap08/FigureThisOut Solution/FigureThisOut Project/My Project/Settings.settings

Chap08/FigureThisOut Solution/FigureThisOut Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "FigureThisOut Project", "FigureThisOut Project\FigureThisOut Project.vbproj", "{F856AEC8-3A6B-440E-BD79-C52658F3BCD3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {F856AEC8-3A6B-440E-BD79-C52658F3BCD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F856AEC8-3A6B-440E-BD79-C52658F3BCD3}.Debug|Any CPU.Build.0 = Debug|Any CPU {F856AEC8-3A6B-440E-BD79-C52658F3BCD3}.Release|Any CPU.ActiveCfg = Release|Any CPU {F856AEC8-3A6B-440E-BD79-C52658F3BCD3}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap08/Net Income Solution/Net Income Project/App.config

Chap08/Net Income Solution/Net Income Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.lblNetIncome = New System.Windows.Forms.Label() Me.txtRevenue = New System.Windows.Forms.TextBox() Me.txtExpenses = New System.Windows.Forms.TextBox() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Net_Income_Project.My.Resources.Resources.EdwardsAndSon Me.PictureBox1.Location = New System.Drawing.Point(59, 14) Me.PictureBox1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(314, 64) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 0 Me.PictureBox1.TabStop = False ' 'lblNetIncome ' Me.lblNetIncome.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblNetIncome.Location = New System.Drawing.Point(305, 134) Me.lblNetIncome.Name = "lblNetIncome" Me.lblNetIncome.Size = New System.Drawing.Size(100, 27) Me.lblNetIncome.TabIndex = 6 Me.lblNetIncome.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'txtRevenue ' Me.txtRevenue.Location = New System.Drawing.Point(38, 134) Me.txtRevenue.Name = "txtRevenue" Me.txtRevenue.Size = New System.Drawing.Size(100, 27) Me.txtRevenue.TabIndex = 1 ' 'txtExpenses ' Me.txtExpenses.Location = New System.Drawing.Point(170, 134) Me.txtExpenses.Name = "txtExpenses" Me.txtExpenses.Size = New System.Drawing.Size(100, 27) Me.txtExpenses.TabIndex = 3 ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(116, 207) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(83, 32) Me.btnCalc.TabIndex = 4 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(219, 207) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(75, 32) Me.btnExit.TabIndex = 5 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(34, 111) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(102, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "Sales &revenue:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(166, 111) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(72, 20) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Expenses:" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(301, 111) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(89, 20) Me.Label3.TabIndex = 7 Me.Label3.Text = "Net income:" ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(432, 286) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.txtExpenses) Me.Controls.Add(Me.txtRevenue) Me.Controls.Add(Me.lblNetIncome) Me.Controls.Add(Me.PictureBox1) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Annual Net Income" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents lblNetIncome As System.Windows.Forms.Label Friend WithEvents txtRevenue As System.Windows.Forms.TextBox Friend WithEvents txtExpenses As System.Windows.Forms.TextBox Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label End Class

Chap08/Net Income Solution/Net Income Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True

Chap08/Net Income Solution/Net Income Project/frmMain.vb

' Name: Net Income Project ' Purpose: Display the annual net income ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates and displays the annual net income Dim decRevenue As Decimal Dim decExpenses As Decimal Dim decNetIncome As Decimal Decimal.TryParse(txtRevenue.Text, decRevenue) Decimal.TryParse(txtExpenses.Text, decExpenses) decNetIncome = decRevenue - decExpenses lblNetIncome.Text = decNetIncome.ToString("C2") End Sub End Class

Chap08/Net Income Solution/Net Income Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17626 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Net_Income_Project.frmMain End Sub End Class End Namespace

Chap08/Net Income Solution/Net Income Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap08/Net Income Solution/Net Income Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Net Income Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Net Income Project")> <Assembly: AssemblyCopyright("Copyright © 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("603452dd-3f73-4715-a9bc-52d04e926eb1")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap08/Net Income Solution/Net Income Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17626 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Net_Income_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property EdwardsAndSon() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("EdwardsAndSon", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace

Chap08/Net Income Solution/Net Income Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\EdwardsAndSon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Chap08/Net Income Solution/Net Income Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17626 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Net_Income_Project.My.MySettings Get Return Global.Net_Income_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap08/Net Income Solution/Net Income Project/My Project/Settings.settings

Chap08/Net Income Solution/Net Income Project/Net Income Project.vbproj

Debug AnyCPU {5A1F54E2-41B8-41B0-A843-8965E83905C7} WinExe Net_Income_Project.My.MyApplication Net_Income_Project Net Income Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Net Income Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Net Income Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap08/Net Income Solution/Net Income Project/Resources/EdwardsAndSon.png

Chap08/Net Income Solution/Net Income Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Net Income Project", "Net Income Project\Net Income Project.vbproj", "{5A1F54E2-41B8-41B0-A843-8965E83905C7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {5A1F54E2-41B8-41B0-A843-8965E83905C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5A1F54E2-41B8-41B0-A843-8965E83905C7}.Debug|Any CPU.Build.0 = Debug|Any CPU {5A1F54E2-41B8-41B0-A843-8965E83905C7}.Release|Any CPU.ActiveCfg = Release|Any CPU {5A1F54E2-41B8-41B0-A843-8965E83905C7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap08/New Pay Solution/New Pay Project/App.config

Chap08/New Pay Solution/New Pay Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.txtCurrentPay = New System.Windows.Forms.TextBox() Me.btnCalculate = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.lblNewPay = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label() Me.txtCode = New System.Windows.Forms.TextBox() Me.PictureBox1 = New System.Windows.Forms.PictureBox() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(101, 17) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(137, 20) Me.Label2.TabIndex = 2 Me.Label2.Text = "Current weekly &pay:" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(270, 17) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(119, 20) Me.Label3.TabIndex = 6 Me.Label3.Text = "New weekly pay:" ' 'txtCurrentPay ' Me.txtCurrentPay.Location = New System.Drawing.Point(105, 41) Me.txtCurrentPay.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtCurrentPay.Name = "txtCurrentPay" Me.txtCurrentPay.Size = New System.Drawing.Size(99, 27) Me.txtCurrentPay.TabIndex = 3 ' 'btnCalculate ' Me.btnCalculate.Location = New System.Drawing.Point(201, 96) Me.btnCalculate.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnCalculate.Name = "btnCalculate" Me.btnCalculate.Size = New System.Drawing.Size(83, 30) Me.btnCalculate.TabIndex = 4 Me.btnCalculate.Text = "&Calculate" Me.btnCalculate.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(290, 96) Me.btnExit.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(83, 30) Me.btnExit.TabIndex = 5 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'lblNewPay ' Me.lblNewPay.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblNewPay.Location = New System.Drawing.Point(274, 41) Me.lblNewPay.Name = "lblNewPay" Me.lblNewPay.Size = New System.Drawing.Size(99, 27) Me.lblNewPay.TabIndex = 7 Me.lblNewPay.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(13, 17) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(72, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "P&ay code:" ' 'txtCode ' Me.txtCode.Location = New System.Drawing.Point(17, 41) Me.txtCode.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtCode.Name = "txtCode" Me.txtCode.Size = New System.Drawing.Size(46, 27) Me.txtCode.TabIndex = 1 ' 'PictureBox1 ' Me.PictureBox1.Image = Global.New_Pay_Project.My.Resources.Resources.PayCheck Me.PictureBox1.Location = New System.Drawing.Point(17, 76) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(100, 50) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 8 Me.PictureBox1.TabStop = False ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(402, 141) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.txtCode) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.lblNewPay) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalculate) Me.Controls.Add(Me.txtCurrentPay) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 6, 3, 6) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "New Pay" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents txtCurrentPay As System.Windows.Forms.TextBox Friend WithEvents btnCalculate As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents lblNewPay As System.Windows.Forms.Label Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtCode As System.Windows.Forms.TextBox Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox End Class

Chap08/New Pay Solution/New Pay Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True

Chap08/New Pay Solution/New Pay Project/frmMain.vb

' Name: New Pay Project ' Purpose: Display the new weekly pay ' Programmmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub End Class

Chap08/New Pay Solution/New Pay Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.New_Pay_Project.frmMain End Sub End Class End Namespace

Chap08/New Pay Solution/New Pay Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap08/New Pay Solution/New Pay Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("New Pay Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("New Pay Project")> <Assembly: AssemblyCopyright("Copyright © Toshiba 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("83fe361d-2c89-4eef-91f6-f053f60fc01d")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap08/New Pay Solution/New Pay Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("New_Pay_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property PayCheck() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("PayCheck", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace

Chap08/New Pay Solution/New Pay Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\PayCheck.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Chap08/New Pay Solution/New Pay Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.New_Pay_Project.My.MySettings Get Return Global.New_Pay_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap08/New Pay Solution/New Pay Project/My Project/Settings.settings

Chap08/New Pay Solution/New Pay Project/New Pay Project.vbproj

Debug AnyCPU {6BD50B6F-4080-4FCE-A8DA-CBBA92BAF7DE} WinExe New_Pay_Project.My.MyApplication New_Pay_Project New Pay Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ New Pay Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ New Pay Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap08/New Pay Solution/New Pay Project/Resources/PayCheck.png

Chap08/New Pay Solution/New Pay Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "New Pay Project", "New Pay Project\New Pay Project.vbproj", "{6BD50B6F-4080-4FCE-A8DA-CBBA92BAF7DE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {6BD50B6F-4080-4FCE-A8DA-CBBA92BAF7DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6BD50B6F-4080-4FCE-A8DA-CBBA92BAF7DE}.Debug|Any CPU.Build.0 = Debug|Any CPU {6BD50B6F-4080-4FCE-A8DA-CBBA92BAF7DE}.Release|Any CPU.ActiveCfg = Release|Any CPU {6BD50B6F-4080-4FCE-A8DA-CBBA92BAF7DE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap08/Quotient Solution/Quotient Project/App.config

Chap08/Quotient Solution/Quotient Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.txtNumerator = New System.Windows.Forms.TextBox() Me.txtDenominator = New System.Windows.Forms.TextBox() Me.lblQuotient = New System.Windows.Forms.Label() Me.PictureBox2 = New System.Windows.Forms.PictureBox() Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'txtNumerator ' Me.txtNumerator.Location = New System.Drawing.Point(34, 62) Me.txtNumerator.Name = "txtNumerator" Me.txtNumerator.Size = New System.Drawing.Size(58, 27) Me.txtNumerator.TabIndex = 0 ' 'txtDenominator ' Me.txtDenominator.Location = New System.Drawing.Point(201, 62) Me.txtDenominator.Name = "txtDenominator" Me.txtDenominator.Size = New System.Drawing.Size(58, 27) Me.txtDenominator.TabIndex = 1 ' 'lblQuotient ' Me.lblQuotient.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblQuotient.Location = New System.Drawing.Point(377, 62) Me.lblQuotient.Name = "lblQuotient" Me.lblQuotient.Size = New System.Drawing.Size(87, 27) Me.lblQuotient.TabIndex = 4 Me.lblQuotient.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'PictureBox2 ' Me.PictureBox2.Image = Global.Quotient_Project.My.Resources.Resources.Equals Me.PictureBox2.Location = New System.Drawing.Point(279, 49) Me.PictureBox2.Name = "PictureBox2" Me.PictureBox2.Size = New System.Drawing.Size(82, 77) Me.PictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox2.TabIndex = 5 Me.PictureBox2.TabStop = False ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Quotient_Project.My.Resources.Resources.DividedBy Me.PictureBox1.Location = New System.Drawing.Point(108, 53) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(77, 50) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 2 Me.PictureBox1.TabStop = False ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(284, 152) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(87, 31) Me.btnCalc.TabIndex = 2 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(377, 152) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(87, 31) Me.btnExit.TabIndex = 3 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(495, 218) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblQuotient) Me.Controls.Add(Me.PictureBox2) Me.Controls.Add(Me.txtDenominator) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.txtNumerator) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Quotient Calculator" CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents txtNumerator As System.Windows.Forms.TextBox Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents txtDenominator As System.Windows.Forms.TextBox Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox Friend WithEvents lblQuotient As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap08/Quotient Solution/Quotient Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True

Chap08/Quotient Solution/Quotient Project/frmMain.vb

' Name: Quotient Project ' Purpose: Divide two numbers and display the quotient ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' display the result of dividing two numbers Dim decNumerator As Decimal Dim decDenominator As Decimal Dim decQuotient As Decimal Decimal.TryParse(txtNumerator.Text, decNumerator) Decimal.TryParse(txtDenominator.Text, decDenominator) decQuotient = decNumerator / decDenominator lblQuotient.Text = decQuotient.ToString("N2") End Sub End Class

Chap08/Quotient Solution/Quotient Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Quotient_Project.frmMain End Sub End Class End Namespace

Chap08/Quotient Solution/Quotient Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap08/Quotient Solution/Quotient Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Quotient Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Quotient Project")> <Assembly: AssemblyCopyright("Copyright © 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("11b7c978-ef63-4561-a27c-07038cc8952d")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap08/Quotient Solution/Quotient Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Quotient_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property DividedBy() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("DividedBy", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property Equals() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Equals", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace

Chap08/Quotient Solution/Quotient Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\DividedBy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Equals.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Chap08/Quotient Solution/Quotient Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Quotient_Project.My.MySettings Get Return Global.Quotient_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap08/Quotient Solution/Quotient Project/My Project/Settings.settings

Chap08/Quotient Solution/Quotient Project/Quotient Project.vbproj

Debug AnyCPU {9C597123-E964-4593-957B-33E53224761F} WinExe Quotient_Project.My.MyApplication Quotient_Project Quotient Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Quotient Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Quotient Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap08/Quotient Solution/Quotient Project/Resources/DividedBy.png

Chap08/Quotient Solution/Quotient Project/Resources/Equals.png

Chap08/Quotient Solution/Quotient Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Quotient Project", "Quotient Project\Quotient Project.vbproj", "{9C597123-E964-4593-957B-33E53224761F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {9C597123-E964-4593-957B-33E53224761F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9C597123-E964-4593-957B-33E53224761F}.Debug|Any CPU.Build.0 = Debug|Any CPU {9C597123-E964-4593-957B-33E53224761F}.Release|Any CPU.ActiveCfg = Release|Any CPU {9C597123-E964-4593-957B-33E53224761F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap08/Swap Solution/Swap Project/App.config

Chap08/Swap Solution/Swap Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.txtFirst = New System.Windows.Forms.TextBox() Me.txtSecond = New System.Windows.Forms.TextBox() Me.Label3 = New System.Windows.Forms.Label() Me.lblLow = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.lblHigh = New System.Windows.Forms.Label() Me.btnSwap = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(22, 34) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(84, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "&First number:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(131, 34) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(103, 17) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Second number:" ' 'txtFirst ' Me.txtFirst.Location = New System.Drawing.Point(22, 54) Me.txtFirst.Name = "txtFirst" Me.txtFirst.Size = New System.Drawing.Size(48, 25) Me.txtFirst.TabIndex = 1 ' 'txtSecond ' Me.txtSecond.Location = New System.Drawing.Point(131, 54) Me.txtSecond.Name = "txtSecond" Me.txtSecond.Size = New System.Drawing.Size(48, 25) Me.txtSecond.TabIndex = 3 ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(22, 98) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(51, 17) Me.Label3.TabIndex = 6 Me.Label3.Text = "Lowest:" ' 'lblLow ' Me.lblLow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblLow.Location = New System.Drawing.Point(22, 115) Me.lblLow.Name = "lblLow" Me.lblLow.Size = New System.Drawing.Size(48, 25) Me.lblLow.TabIndex = 7 Me.lblLow.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(131, 98) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(55, 17) Me.Label4.TabIndex = 8 Me.Label4.Text = "Highest:" ' 'lblHigh ' Me.lblHigh.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblHigh.Location = New System.Drawing.Point(131, 115) Me.lblHigh.Name = "lblHigh" Me.lblHigh.Size = New System.Drawing.Size(48, 25) Me.lblHigh.TabIndex = 9 Me.lblHigh.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnSwap ' Me.btnSwap.Location = New System.Drawing.Point(22, 169) Me.btnSwap.Name = "btnSwap" Me.btnSwap.Size = New System.Drawing.Size(75, 31) Me.btnSwap.TabIndex = 4 Me.btnSwap.Text = "S&wap" Me.btnSwap.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(131, 169) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(75, 31) Me.btnExit.TabIndex = 5 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(256, 231) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnSwap) Me.Controls.Add(Me.lblHigh) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.lblLow) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.txtSecond) Me.Controls.Add(Me.txtFirst) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Swapping" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtFirst As System.Windows.Forms.TextBox Friend WithEvents txtSecond As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents lblLow As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents lblHigh As System.Windows.Forms.Label Friend WithEvents btnSwap As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap08/Swap Solution/Swap Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True

Chap08/Swap Solution/Swap Project/frmMain.vb

' Name: Swap Project ' Purpose: Swaps two numbers, if necessary ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnSwap_Click(sender As Object, e As EventArgs) Handles btnSwap.Click ' swaps two numbers, if necessary Dim intNum1 As Integer Dim intNum2 As Integer Integer.TryParse(txtFirst.Text, intNum1) Integer.TryParse(txtSecond.Text, intNum2) ' swap numbers, if necessary ' display lowest and highest number lblLow.Text = intNum1.ToString lblHigh.Text = intNum2.ToString End Sub End Class

Chap08/Swap Solution/Swap Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Swap_Project.frmMain End Sub End Class End Namespace

Chap08/Swap Solution/Swap Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap08/Swap Solution/Swap Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Swap Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("Swap Project")> <Assembly: AssemblyCopyright("Copyright © Toshiba 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("9bf032ee-5121-40ac-81dd-f9450991c7e1")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap08/Swap Solution/Swap Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Swap_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap08/Swap Solution/Swap Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap08/Swap Solution/Swap Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Swap_Project.My.MySettings Get Return Global.Swap_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap08/Swap Solution/Swap Project/My Project/Settings.settings

Chap08/Swap Solution/Swap Project/Swap Project.vbproj

Debug AnyCPU {35FFD448-6534-4A33-9D52-C60167AC51F7} WinExe Swap_Project.My.MyApplication Swap_Project Swap Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Swap Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Swap Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap08/Swap Solution/Swap Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Swap Project", "Swap Project\Swap Project.vbproj", "{35FFD448-6534-4A33-9D52-C60167AC51F7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {35FFD448-6534-4A33-9D52-C60167AC51F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {35FFD448-6534-4A33-9D52-C60167AC51F7}.Debug|Any CPU.Build.0 = Debug|Any CPU {35FFD448-6534-4A33-9D52-C60167AC51F7}.Release|Any CPU.ActiveCfg = Release|Any CPU {35FFD448-6534-4A33-9D52-C60167AC51F7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap08/SwatTheBugs Solution/SwatTheBugs Project/App.config

Chap08/SwatTheBugs Solution/SwatTheBugs Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.chk25Coupon = New System.Windows.Forms.CheckBox() Me.Label1 = New System.Windows.Forms.Label() Me.txtNumCds = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.txtCdPrice = New System.Windows.Forms.TextBox() Me.Label3 = New System.Windows.Forms.Label() Me.lblTotal = New System.Windows.Forms.Label() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'chk25Coupon ' Me.chk25Coupon.AutoSize = True Me.chk25Coupon.Location = New System.Drawing.Point(156, 36) Me.chk25Coupon.Name = "chk25Coupon" Me.chk25Coupon.Size = New System.Drawing.Size(100, 21) Me.chk25Coupon.TabIndex = 4 Me.chk25Coupon.Text = "25% &coupon" Me.chk25Coupon.UseVisualStyleBackColor = True ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(20, 36) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(102, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Number of CDs:" ' 'txtNumCds ' Me.txtNumCds.Location = New System.Drawing.Point(20, 57) Me.txtNumCds.Name = "txtNumCds" Me.txtNumCds.Size = New System.Drawing.Size(65, 25) Me.txtNumCds.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(20, 103) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(84, 17) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Price per CD:" ' 'txtCdPrice ' Me.txtCdPrice.Location = New System.Drawing.Point(20, 124) Me.txtCdPrice.Name = "txtCdPrice" Me.txtCdPrice.Size = New System.Drawing.Size(65, 25) Me.txtCdPrice.TabIndex = 3 ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(153, 103) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(40, 17) Me.Label3.TabIndex = 7 Me.Label3.Text = "Total:" ' 'lblTotal ' Me.lblTotal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblTotal.Location = New System.Drawing.Point(153, 121) Me.lblTotal.Name = "lblTotal" Me.lblTotal.Size = New System.Drawing.Size(103, 25) Me.lblTotal.TabIndex = 8 Me.lblTotal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(113, 193) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(88, 31) Me.btnCalc.TabIndex = 5 Me.btnCalc.Text = "Ca&lculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(207, 193) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(62, 31) Me.btnExit.TabIndex = 6 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(290, 260) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblTotal) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.txtCdPrice) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtNumCds) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.chk25Coupon) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Swat The Bugs" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents chk25Coupon As System.Windows.Forms.CheckBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtNumCds As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtCdPrice As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents lblTotal As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap08/SwatTheBugs Solution/SwatTheBugs Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True

Chap08/SwatTheBugs Solution/SwatTheBugs Project/frmMain.vb

' Name: SwatTheBugs Project ' Purpose: Display the total owed ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates and displays the total amount owed Dim intNumCds As Integer Dim decCdPrice As Decimal Dim decTotalOwed As Decimal ' assign number of CDs and price to variables Integer.TryParse(txtNumCds.Text, intNumCds) Decimal.TryParse(txtCdPrice.Text, decCdPrice) ' determine whether the customer has a 25% coupon If chk25Coupon.Checked = True Then decCdPrice = decCdPrice * 0.25 End If ' calculate and display the total amount owed decTotalOwed = intNumCds + decCdPrice lblTotal.Text = decTotalOwed.ToString("C2") End Sub End Class

Chap08/SwatTheBugs Solution/SwatTheBugs Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.SwatTheBugs_Project.frmMain End Sub End Class End Namespace

Chap08/SwatTheBugs Solution/SwatTheBugs Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap08/SwatTheBugs Solution/SwatTheBugs Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("SwatTheBugs Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("SwatTheBugs Project")> <Assembly: AssemblyCopyright("Copyright © Toshiba 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("46f1f6fd-d463-4955-aea9-027118a3cb5b")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap08/SwatTheBugs Solution/SwatTheBugs Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("SwatTheBugs_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap08/SwatTheBugs Solution/SwatTheBugs Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap08/SwatTheBugs Solution/SwatTheBugs Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.SwatTheBugs_Project.My.MySettings Get Return Global.SwatTheBugs_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap08/SwatTheBugs Solution/SwatTheBugs Project/My Project/Settings.settings

Chap08/SwatTheBugs Solution/SwatTheBugs Project/SwatTheBugs Project.vbproj

Debug AnyCPU {FF788814-75D4-4B67-A122-935098E76D24} WinExe SwatTheBugs_Project.My.MyApplication SwatTheBugs_Project SwatTheBugs Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ SwatTheBugs Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ SwatTheBugs Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap08/SwatTheBugs Solution/SwatTheBugs Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SwatTheBugs Project", "SwatTheBugs Project\SwatTheBugs Project.vbproj", "{FF788814-75D4-4B67-A122-935098E76D24}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {FF788814-75D4-4B67-A122-935098E76D24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FF788814-75D4-4B67-A122-935098E76D24}.Debug|Any CPU.Build.0 = Debug|Any CPU {FF788814-75D4-4B67-A122-935098E76D24}.Release|Any CPU.ActiveCfg = Release|Any CPU {FF788814-75D4-4B67-A122-935098E76D24}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap08/TeaTime.png

Chap08/Total Due Solution/Total Due Project/App.config

Chap08/Total Due Solution/Total Due Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.txtQuantity = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.txtPrice = New System.Windows.Forms.TextBox() Me.Label3 = New System.Windows.Forms.Label() Me.lblTotalDue = New System.Windows.Forms.Label() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(22, 28) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(68, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Quantity:" ' 'txtQuantity ' Me.txtQuantity.Location = New System.Drawing.Point(26, 51) Me.txtQuantity.Name = "txtQuantity" Me.txtQuantity.Size = New System.Drawing.Size(64, 27) Me.txtQuantity.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(114, 28) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(44, 20) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Price:" ' 'txtPrice ' Me.txtPrice.Location = New System.Drawing.Point(118, 51) Me.txtPrice.Name = "txtPrice" Me.txtPrice.Size = New System.Drawing.Size(73, 27) Me.txtPrice.TabIndex = 3 ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(22, 93) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(75, 20) Me.Label3.TabIndex = 5 Me.Label3.Text = "Total due:" ' 'lblTotalDue ' Me.lblTotalDue.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblTotalDue.Font = New System.Drawing.Font("Segoe UI", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblTotalDue.Location = New System.Drawing.Point(26, 113) Me.lblTotalDue.Name = "lblTotalDue" Me.lblTotalDue.Size = New System.Drawing.Size(165, 43) Me.lblTotalDue.TabIndex = 6 Me.lblTotalDue.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(213, 88) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(94, 31) Me.btnCalc.TabIndex = 7 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(213, 125) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(94, 31) Me.btnExit.TabIndex = 8 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(329, 191) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblTotalDue) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.txtPrice) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtQuantity) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Total Due" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtQuantity As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtPrice As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents lblTotalDue As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap08/Total Due Solution/Total Due Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap08/Total Due Solution/Total Due Project/frmMain.vb

' Name: Total Due Project ' Purpose: Display the total amount due ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates and displays the total amount due Const decDISC_RATE As Decimal = 0.1 Dim intQuantity As Integer Dim decPrice As Decimal Dim decSubtotal As Decimal Dim decDiscount As Decimal Dim decTotal As Decimal ' assign quantity and price to variables Integer.TryParse(txtQuantity.Text, intQuantity) Decimal.TryParse(txtPrice.Text, decPrice) ' calculate subtotal, discount, and total due ' display total due lblTotalDue.Text = decTotal.ToString("C2") End Sub End Class

Chap08/Total Due Solution/Total Due Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Total_Due_Project.frmMain End Sub End Class End Namespace

Chap08/Total Due Solution/Total Due Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap08/Total Due Solution/Total Due Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Total Due Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Total Due Project")> <Assembly: AssemblyCopyright("Copyright © 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("8210834a-d892-474a-846e-f656364334ea")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap08/Total Due Solution/Total Due Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Total_Due_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap08/Total Due Solution/Total Due Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap08/Total Due Solution/Total Due Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Total_Due_Project.My.MySettings Get Return Global.Total_Due_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap08/Total Due Solution/Total Due Project/My Project/Settings.settings

Chap08/Total Due Solution/Total Due Project/Total Due Project.vbproj

Debug AnyCPU {1555E43B-9496-44CC-BBFE-870C9BB995DF} WinExe Total_Due_Project.My.MyApplication Total_Due_Project Total Due Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Total Due Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Total Due Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap08/Total Due Solution/Total Due Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Total Due Project", "Total Due Project\Total Due Project.vbproj", "{1555E43B-9496-44CC-BBFE-870C9BB995DF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {1555E43B-9496-44CC-BBFE-870C9BB995DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1555E43B-9496-44CC-BBFE-870C9BB995DF}.Debug|Any CPU.Build.0 = Debug|Any CPU {1555E43B-9496-44CC-BBFE-870C9BB995DF}.Release|Any CPU.ActiveCfg = Release|Any CPU {1555E43B-9496-44CC-BBFE-870C9BB995DF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap08/Total Due Solution-Version 2/Total Due Project/App.config

Chap08/Total Due Solution-Version 2/Total Due Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.txtQuantity = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.txtPrice = New System.Windows.Forms.TextBox() Me.Label3 = New System.Windows.Forms.Label() Me.lblTotalDue = New System.Windows.Forms.Label() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.chkEmployee = New System.Windows.Forms.CheckBox() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(22, 28) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(68, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Quantity:" ' 'txtQuantity ' Me.txtQuantity.Location = New System.Drawing.Point(26, 51) Me.txtQuantity.Name = "txtQuantity" Me.txtQuantity.Size = New System.Drawing.Size(64, 27) Me.txtQuantity.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(114, 28) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(44, 20) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Price:" ' 'txtPrice ' Me.txtPrice.Location = New System.Drawing.Point(118, 51) Me.txtPrice.Name = "txtPrice" Me.txtPrice.Size = New System.Drawing.Size(73, 27) Me.txtPrice.TabIndex = 3 ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(22, 93) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(75, 20) Me.Label3.TabIndex = 7 Me.Label3.Text = "Total due:" ' 'lblTotalDue ' Me.lblTotalDue.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblTotalDue.Font = New System.Drawing.Font("Segoe UI", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblTotalDue.Location = New System.Drawing.Point(26, 113) Me.lblTotalDue.Name = "lblTotalDue" Me.lblTotalDue.Size = New System.Drawing.Size(165, 43) Me.lblTotalDue.TabIndex = 8 Me.lblTotalDue.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(213, 88) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(94, 31) Me.btnCalc.TabIndex = 5 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(213, 125) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(94, 31) Me.btnExit.TabIndex = 6 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'chkEmployee ' Me.chkEmployee.AutoSize = True Me.chkEmployee.Location = New System.Drawing.Point(213, 30) Me.chkEmployee.Name = "chkEmployee" Me.chkEmployee.Size = New System.Drawing.Size(94, 24) Me.chkEmployee.TabIndex = 4 Me.chkEmployee.Text = "&Employee" Me.chkEmployee.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(329, 191) Me.Controls.Add(Me.chkEmployee) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblTotalDue) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.txtPrice) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtQuantity) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Total Due" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtQuantity As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtPrice As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents lblTotalDue As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents chkEmployee As System.Windows.Forms.CheckBox End Class

Chap08/Total Due Solution-Version 2/Total Due Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True

Chap08/Total Due Solution-Version 2/Total Due Project/frmMain.vb

' Name: Total Due Project ' Purpose: Display the total amount due ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub End Class

Chap08/Total Due Solution-Version 2/Total Due Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Total_Due_Project.frmMain End Sub End Class End Namespace

Chap08/Total Due Solution-Version 2/Total Due Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap08/Total Due Solution-Version 2/Total Due Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Total Due Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Total Due Project")> <Assembly: AssemblyCopyright("Copyright © 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("8210834a-d892-474a-846e-f656364334ea")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap08/Total Due Solution-Version 2/Total Due Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Total_Due_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap08/Total Due Solution-Version 2/Total Due Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap08/Total Due Solution-Version 2/Total Due Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Total_Due_Project.My.MySettings Get Return Global.Total_Due_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap08/Total Due Solution-Version 2/Total Due Project/My Project/Settings.settings

Chap08/Total Due Solution-Version 2/Total Due Project/Total Due Project.vbproj

Debug AnyCPU {1555E43B-9496-44CC-BBFE-870C9BB995DF} WinExe Total_Due_Project.My.MyApplication Total_Due_Project Total Due Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Total Due Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Total Due Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap08/Total Due Solution-Version 2/Total Due Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Total Due Project", "Total Due Project\Total Due Project.vbproj", "{1555E43B-9496-44CC-BBFE-870C9BB995DF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {1555E43B-9496-44CC-BBFE-870C9BB995DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1555E43B-9496-44CC-BBFE-870C9BB995DF}.Debug|Any CPU.Build.0 = Debug|Any CPU {1555E43B-9496-44CC-BBFE-870C9BB995DF}.Release|Any CPU.ActiveCfg = Release|Any CPU {1555E43B-9496-44CC-BBFE-870C9BB995DF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap08/Total Due Solution-Version 3/Total Due Project/App.config

Chap08/Total Due Solution-Version 3/Total Due Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.txtQuantity = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.txtPrice = New System.Windows.Forms.TextBox() Me.Label3 = New System.Windows.Forms.Label() Me.lblTotalDue = New System.Windows.Forms.Label() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.chkEmployee = New System.Windows.Forms.CheckBox() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(22, 28) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(68, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Quantity:" ' 'txtQuantity ' Me.txtQuantity.Location = New System.Drawing.Point(26, 51) Me.txtQuantity.Name = "txtQuantity" Me.txtQuantity.Size = New System.Drawing.Size(64, 27) Me.txtQuantity.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(114, 28) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(44, 20) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Price:" ' 'txtPrice ' Me.txtPrice.Location = New System.Drawing.Point(118, 51) Me.txtPrice.Name = "txtPrice" Me.txtPrice.Size = New System.Drawing.Size(73, 27) Me.txtPrice.TabIndex = 3 ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(22, 93) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(75, 20) Me.Label3.TabIndex = 7 Me.Label3.Text = "Total due:" ' 'lblTotalDue ' Me.lblTotalDue.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblTotalDue.Font = New System.Drawing.Font("Segoe UI", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblTotalDue.Location = New System.Drawing.Point(26, 113) Me.lblTotalDue.Name = "lblTotalDue" Me.lblTotalDue.Size = New System.Drawing.Size(165, 43) Me.lblTotalDue.TabIndex = 8 Me.lblTotalDue.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(213, 88) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(94, 31) Me.btnCalc.TabIndex = 5 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(213, 125) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(94, 31) Me.btnExit.TabIndex = 6 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'chkEmployee ' Me.chkEmployee.AutoSize = True Me.chkEmployee.Location = New System.Drawing.Point(213, 30) Me.chkEmployee.Name = "chkEmployee" Me.chkEmployee.Size = New System.Drawing.Size(94, 24) Me.chkEmployee.TabIndex = 4 Me.chkEmployee.Text = "&Employee" Me.chkEmployee.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(329, 191) Me.Controls.Add(Me.chkEmployee) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblTotalDue) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.txtPrice) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtQuantity) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Total Due" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtQuantity As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtPrice As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents lblTotalDue As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents chkEmployee As System.Windows.Forms.CheckBox End Class

Chap08/Total Due Solution-Version 3/Total Due Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True

Chap08/Total Due Solution-Version 3/Total Due Project/frmMain.vb

' Name: Total Due Project ' Purpose: Display the total amount due ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub End Class

Chap08/Total Due Solution-Version 3/Total Due Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Total_Due_Project.frmMain End Sub End Class End Namespace

Chap08/Total Due Solution-Version 3/Total Due Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap08/Total Due Solution-Version 3/Total Due Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Total Due Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Total Due Project")> <Assembly: AssemblyCopyright("Copyright © 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("8210834a-d892-474a-846e-f656364334ea")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap08/Total Due Solution-Version 3/Total Due Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Total_Due_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap08/Total Due Solution-Version 3/Total Due Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap08/Total Due Solution-Version 3/Total Due Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Total_Due_Project.My.MySettings Get Return Global.Total_Due_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap08/Total Due Solution-Version 3/Total Due Project/My Project/Settings.settings

Chap08/Total Due Solution-Version 3/Total Due Project/Total Due Project.vbproj

Debug AnyCPU {1555E43B-9496-44CC-BBFE-870C9BB995DF} WinExe Total_Due_Project.My.MyApplication Total_Due_Project Total Due Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Total Due Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Total Due Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap08/Total Due Solution-Version 3/Total Due Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Total Due Project", "Total Due Project\Total Due Project.vbproj", "{1555E43B-9496-44CC-BBFE-870C9BB995DF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {1555E43B-9496-44CC-BBFE-870C9BB995DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1555E43B-9496-44CC-BBFE-870C9BB995DF}.Debug|Any CPU.Build.0 = Debug|Any CPU {1555E43B-9496-44CC-BBFE-870C9BB995DF}.Release|Any CPU.ActiveCfg = Release|Any CPU {1555E43B-9496-44CC-BBFE-870C9BB995DF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap08/Water.png

Chap07/Allenton Solution/Allenton Project/Allenton Project.vbproj

Debug AnyCPU {5EC6A2D8-3932-4A50-98B5-AE578EEF32D3} WinExe Allenton_Project.My.MyApplication Allenton_Project Allenton Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Allenton Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Allenton Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap07/Allenton Solution/Allenton Project/App.config

Chap07/Allenton Solution/Allenton Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.txtEarth = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.lblJupiter = New System.Windows.Forms.Label() Me.lblVenus = New System.Windows.Forms.Label() Me.lblMars = New System.Windows.Forms.Label() Me.lblMoon = New System.Windows.Forms.Label() Me.btnDisplay = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.Label6 = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(32, 34) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(114, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "Your earth &weight:" ' 'txtEarth ' Me.txtEarth.Location = New System.Drawing.Point(148, 31) Me.txtEarth.Name = "txtEarth" Me.txtEarth.Size = New System.Drawing.Size(49, 25) Me.txtEarth.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(32, 102) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(50, 17) Me.Label2.TabIndex = 5 Me.Label2.Text = "Jupiter:" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(32, 140) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(46, 17) Me.Label3.TabIndex = 7 Me.Label3.Text = "Venus:" ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(32, 178) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(41, 17) Me.Label4.TabIndex = 9 Me.Label4.Text = "Mars:" ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Location = New System.Drawing.Point(32, 218) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(46, 17) Me.Label5.TabIndex = 11 Me.Label5.Text = "Moon:" ' 'lblJupiter ' Me.lblJupiter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblJupiter.Location = New System.Drawing.Point(83, 101) Me.lblJupiter.Name = "lblJupiter" Me.lblJupiter.Size = New System.Drawing.Size(70, 30) Me.lblJupiter.TabIndex = 6 Me.lblJupiter.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'lblVenus ' Me.lblVenus.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblVenus.Location = New System.Drawing.Point(83, 139) Me.lblVenus.Name = "lblVenus" Me.lblVenus.Size = New System.Drawing.Size(70, 30) Me.lblVenus.TabIndex = 8 Me.lblVenus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'lblMars ' Me.lblMars.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblMars.Location = New System.Drawing.Point(83, 177) Me.lblMars.Name = "lblMars" Me.lblMars.Size = New System.Drawing.Size(70, 30) Me.lblMars.TabIndex = 10 Me.lblMars.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'lblMoon ' Me.lblMoon.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblMoon.Location = New System.Drawing.Point(83, 217) Me.lblMoon.Name = "lblMoon" Me.lblMoon.Size = New System.Drawing.Size(70, 30) Me.lblMoon.TabIndex = 12 Me.lblMoon.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnDisplay ' Me.btnDisplay.Location = New System.Drawing.Point(167, 92) Me.btnDisplay.Name = "btnDisplay" Me.btnDisplay.Size = New System.Drawing.Size(111, 36) Me.btnDisplay.TabIndex = 2 Me.btnDisplay.Text = "&Display Weights" Me.btnDisplay.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(167, 134) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(111, 36) Me.btnExit.TabIndex = 3 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'Label6 ' Me.Label6.AutoSize = True Me.Label6.Location = New System.Drawing.Point(32, 72) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(99, 17) Me.Label6.TabIndex = 4 Me.Label6.Text = "Your weight on:" ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(309, 280) Me.Controls.Add(Me.Label6) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnDisplay) Me.Controls.Add(Me.lblMoon) Me.Controls.Add(Me.lblMars) Me.Controls.Add(Me.lblVenus) Me.Controls.Add(Me.lblJupiter) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtEarth) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Allenton Observatory" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtEarth As System.Windows.Forms.TextBox 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 lblJupiter As System.Windows.Forms.Label Friend WithEvents lblVenus As System.Windows.Forms.Label Friend WithEvents lblMars As System.Windows.Forms.Label Friend WithEvents lblMoon As System.Windows.Forms.Label Friend WithEvents btnDisplay As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents Label6 As System.Windows.Forms.Label End Class

Chap07/Allenton Solution/Allenton Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True True True True

Chap07/Allenton Solution/Allenton Project/frmMain.vb

' Name: Allenton Project ' Purpose: Display weight on planets and the moon ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnDisplay_Click(sender As Object, e As EventArgs) Handles btnDisplay.Click ' calculates and displays your weight on other planets and the moon ' Jupiter is 2.54 times earth weight, Venus is .91, Mars is .38, and the moon is .17 Dim dblEarth As Double Dim dblJupiter As Double Dim dblVenus As Double Dim dblMars As Double Dim dblMoon As Double ' calculate weights dblJupiter = dblEarth * 2.54 dblVenus = dblEarth * 0.91 dblMars = dblEarth * 0.38 dblMoon = dblEarth * 0.17 ' display weights lblJupiter.Text = dblJupiter.ToString("N2") lblVenus.Text = dblVenus.ToString("N2") lblMars.Text = dblMars.ToString("N2") lblMoon.Text = dblMars.ToString("N2") End Sub End Class

Chap07/Allenton Solution/Allenton Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Allenton_Project.frmMain End Sub End Class End Namespace

Chap07/Allenton Solution/Allenton Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap07/Allenton Solution/Allenton Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Allenton Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("Allenton Project")> <Assembly: AssemblyCopyright("Copyright © Toshiba 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("cad20550-f193-4b43-bed4-6bbdf136b760")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap07/Allenton Solution/Allenton Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Allenton_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap07/Allenton Solution/Allenton Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap07/Allenton Solution/Allenton Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Allenton_Project.My.MySettings Get Return Global.Allenton_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap07/Allenton Solution/Allenton Project/My Project/Settings.settings

Chap07/Allenton Solution/Allenton Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Allenton Project", "Allenton Project\Allenton Project.vbproj", "{5EC6A2D8-3932-4A50-98B5-AE578EEF32D3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {5EC6A2D8-3932-4A50-98B5-AE578EEF32D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5EC6A2D8-3932-4A50-98B5-AE578EEF32D3}.Debug|Any CPU.Build.0 = Debug|Any CPU {5EC6A2D8-3932-4A50-98B5-AE578EEF32D3}.Release|Any CPU.ActiveCfg = Release|Any CPU {5EC6A2D8-3932-4A50-98B5-AE578EEF32D3}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap07/Average Score Solution/Average Score Project/App.config

Chap07/Average Score Solution/Average Score Project/Average Score Project.vbproj

Debug AnyCPU {9A8A1EF8-85B5-444C-9C3A-C926FE5047D8} WinExe Average_Score_Project.My.MyApplication Average_Score_Project Average Score Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Average Score Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Average Score Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap07/Average Score Solution/Average Score Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.txtScore1 = New System.Windows.Forms.TextBox() Me.txtScore2 = New System.Windows.Forms.TextBox() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.Label4 = New System.Windows.Forms.Label() Me.lblAvg = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(27, 25) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(55, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "Score &1:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(27, 62) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(55, 17) Me.Label2.TabIndex = 2 Me.Label2.Text = "Score &2:" ' 'txtScore1 ' Me.txtScore1.Location = New System.Drawing.Point(85, 22) Me.txtScore1.Name = "txtScore1" Me.txtScore1.Size = New System.Drawing.Size(51, 25) Me.txtScore1.TabIndex = 1 ' 'txtScore2 ' Me.txtScore2.Location = New System.Drawing.Point(85, 59) Me.txtScore2.Name = "txtScore2" Me.txtScore2.Size = New System.Drawing.Size(51, 25) Me.txtScore2.TabIndex = 3 ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(171, 22) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(87, 36) Me.btnCalc.TabIndex = 4 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(171, 65) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(87, 36) Me.btnExit.TabIndex = 5 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(27, 113) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(59, 17) Me.Label4.TabIndex = 6 Me.Label4.Text = "Average:" ' 'lblAvg ' Me.lblAvg.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblAvg.Location = New System.Drawing.Point(85, 112) Me.lblAvg.Name = "lblAvg" Me.lblAvg.Size = New System.Drawing.Size(73, 29) Me.lblAvg.TabIndex = 7 Me.lblAvg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(293, 170) Me.Controls.Add(Me.lblAvg) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.txtScore2) Me.Controls.Add(Me.txtScore1) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Average Score Calculator" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtScore1 As System.Windows.Forms.TextBox Friend WithEvents txtScore2 As System.Windows.Forms.TextBox Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents lblAvg As System.Windows.Forms.Label End Class

Chap07/Average Score Solution/Average Score Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True

Chap07/Average Score Solution/Average Score Project/frmMain.vb

' Name: Average Score Project ' Purpose: Display the average score ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates and displays the average of two test scores ' declare variables Dim dblScore1 As Double Dim dblScore2 As Double Dim dblAverage As Double ' assign input to variables Double.TryParse(txtScore1.Text, dblScore1) Double.TryParse(txtScore2.Text, dblScore2) ' calculate average score dblAverage = dblScore1 + dblScore2 / 2 ' display average score lblAvg.Text = dblAverage End Sub End Class

Chap07/Average Score Solution/Average Score Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Average_Score_Project.frmMain End Sub End Class End Namespace

Chap07/Average Score Solution/Average Score Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap07/Average Score Solution/Average Score Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Average Score Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("Average Score Project")> <Assembly: AssemblyCopyright("Copyright © Toshiba 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("ca1852ec-8bf1-4f97-80f5-6bede81654f7")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap07/Average Score Solution/Average Score Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Average_Score_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap07/Average Score Solution/Average Score Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap07/Average Score Solution/Average Score Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Average_Score_Project.My.MySettings Get Return Global.Average_Score_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap07/Average Score Solution/Average Score Project/My Project/Settings.settings

Chap07/Average Score Solution/Average Score Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Average Score Project", "Average Score Project\Average Score Project.vbproj", "{9A8A1EF8-85B5-444C-9C3A-C926FE5047D8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {9A8A1EF8-85B5-444C-9C3A-C926FE5047D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9A8A1EF8-85B5-444C-9C3A-C926FE5047D8}.Debug|Any CPU.Build.0 = Debug|Any CPU {9A8A1EF8-85B5-444C-9C3A-C926FE5047D8}.Release|Any CPU.ActiveCfg = Release|Any CPU {9A8A1EF8-85B5-444C-9C3A-C926FE5047D8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap07/Beachwood Solution/Beachwood Project/App.config

Chap07/Beachwood Solution/Beachwood Project/Beachwood Project.vbproj

Debug AnyCPU {B2E7865E-ECDE-4379-BD00-2F5A3C6AE5C8} WinExe Beachwood_Project.My.MyApplication Beachwood_Project Beachwood Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Beachwood Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Beachwood Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap07/Beachwood Solution/Beachwood Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.btnExit = New System.Windows.Forms.Button() Me.btnCalc = New System.Windows.Forms.Button() Me.txtDecaf = New System.Windows.Forms.TextBox() Me.txtRegular = New System.Windows.Forms.TextBox() Me.lblTotalPrice = New System.Windows.Forms.Label() Me.lblPounds = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label6 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label() Me.lblShipping = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'btnExit ' Me.btnExit.DialogResult = System.Windows.Forms.DialogResult.Cancel Me.btnExit.Location = New System.Drawing.Point(173, 177) Me.btnExit.Margin = New System.Windows.Forms.Padding(2) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(113, 32) Me.btnExit.TabIndex = 5 Me.btnExit.Text = "E&xit" ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(173, 141) Me.btnCalc.Margin = New System.Windows.Forms.Padding(2) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(113, 32) Me.btnCalc.TabIndex = 4 Me.btnCalc.Text = "&Calculate Order" ' 'txtDecaf ' Me.txtDecaf.Location = New System.Drawing.Point(99, 79) Me.txtDecaf.Margin = New System.Windows.Forms.Padding(2) Me.txtDecaf.Name = "txtDecaf" Me.txtDecaf.Size = New System.Drawing.Size(46, 25) Me.txtDecaf.TabIndex = 3 ' 'txtRegular ' Me.txtRegular.Location = New System.Drawing.Point(25, 79) Me.txtRegular.Margin = New System.Windows.Forms.Padding(2) Me.txtRegular.Name = "txtRegular" Me.txtRegular.Size = New System.Drawing.Size(46, 25) Me.txtRegular.TabIndex = 1 ' 'lblTotalPrice ' Me.lblTotalPrice.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblTotalPrice.Location = New System.Drawing.Point(25, 210) Me.lblTotalPrice.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.lblTotalPrice.Name = "lblTotalPrice" Me.lblTotalPrice.Size = New System.Drawing.Size(114, 26) Me.lblTotalPrice.TabIndex = 12 Me.lblTotalPrice.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'lblPounds ' Me.lblPounds.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblPounds.Location = New System.Drawing.Point(173, 80) Me.lblPounds.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.lblPounds.Name = "lblPounds" Me.lblPounds.Size = New System.Drawing.Size(46, 25) Me.lblPounds.TabIndex = 8 Me.lblPounds.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(25, 193) Me.Label2.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(73, 17) Me.Label2.TabIndex = 11 Me.Label2.Text = "Total price:" ' 'Label6 ' Me.Label6.AutoSize = True Me.Label6.Location = New System.Drawing.Point(173, 61) Me.Label6.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(106, 17) Me.Label6.TabIndex = 7 Me.Label6.Text = "Pounds ordered:" ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Location = New System.Drawing.Point(99, 61) Me.Label5.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(44, 17) Me.Label5.TabIndex = 2 Me.Label5.Text = "&Decaf:" ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(25, 60) Me.Label4.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(56, 17) Me.Label4.TabIndex = 0 Me.Label4.Text = "&Regular:" ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Font = New System.Drawing.Font("Segoe UI", 16.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(92, 9) Me.Label1.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(128, 30) Me.Label1.TabIndex = 6 Me.Label1.Text = "Order Form" ' 'lblShipping ' Me.lblShipping.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblShipping.Location = New System.Drawing.Point(25, 158) Me.lblShipping.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.lblShipping.Name = "lblShipping" Me.lblShipping.Size = New System.Drawing.Size(114, 26) Me.lblShipping.TabIndex = 10 Me.lblShipping.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(25, 141) Me.Label3.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(62, 17) Me.Label3.TabIndex = 9 Me.Label3.Text = "Shipping:" ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(312, 258) Me.Controls.Add(Me.lblShipping) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.txtDecaf) Me.Controls.Add(Me.txtRegular) Me.Controls.Add(Me.lblTotalPrice) Me.Controls.Add(Me.lblPounds) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label6) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Beachwood Coffee" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents txtDecaf As System.Windows.Forms.TextBox Friend WithEvents txtRegular As System.Windows.Forms.TextBox Friend WithEvents lblTotalPrice As System.Windows.Forms.Label Friend WithEvents lblPounds As System.Windows.Forms.Label Friend WithEvents Label6 As System.Windows.Forms.Label Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents lblShipping As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label End Class

Chap07/Beachwood Solution/Beachwood Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True True True True

Chap07/Beachwood Solution/Beachwood Project/frmMain.vb

' Name: Beachwood Project ' Purpose: Display the total pounds of coffee ' ordered and the total price of the order, ' including sales tax and shipping ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates and displays the total pounds of coffee ordered ' and the total price of the order, including sales tax and shipping ' declare constants and variables Const decPRICE_PER_POUND As Decimal = 11.15 Const decSALES_TAX_RATE As Decimal = 0.02 Const decSHIPPING_CHARGE As Decimal = 5.0 Dim intRegular As Integer Dim intDecaf As Integer Dim intTotalPounds As Integer Dim decSubTotal As Decimal Dim decSalesTax As Decimal Dim decTotalPrice As Decimal ' assign input to variables Integer.TryParse(txtRegular.Text, intRegular) Integer.TryParse(txtDecaf.Text, intDecaf ' perform calculations decSubTotal = intTotalPounds * decPRICE_PER_POUND decSalesTax = decSubTotal * decSALES_TAX_RATE decTotalPrice = decSubTotal + decSalesTax ' display shipping and calculated results lblPounds.Text = intTotalPounds lblTotalPrice.Text = decTotalPrice.ToString("C2") End Sub End Class

Chap07/Beachwood Solution/Beachwood Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Beachwood_Project.frmMain End Sub End Class End Namespace

Chap07/Beachwood Solution/Beachwood Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap07/Beachwood Solution/Beachwood Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Beachwood Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("Beachwood Project")> <Assembly: AssemblyCopyright("Copyright © Toshiba 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("dacc9eb4-c99a-431c-ae23-35d53a385895")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap07/Beachwood Solution/Beachwood Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Beachwood_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap07/Beachwood Solution/Beachwood Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap07/Beachwood Solution/Beachwood Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Beachwood_Project.My.MySettings Get Return Global.Beachwood_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap07/Beachwood Solution/Beachwood Project/My Project/Settings.settings

Chap07/Beachwood Solution/Beachwood Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Beachwood Project", "Beachwood Project\Beachwood Project.vbproj", "{B2E7865E-ECDE-4379-BD00-2F5A3C6AE5C8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {B2E7865E-ECDE-4379-BD00-2F5A3C6AE5C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B2E7865E-ECDE-4379-BD00-2F5A3C6AE5C8}.Debug|Any CPU.Build.0 = Debug|Any CPU {B2E7865E-ECDE-4379-BD00-2F5A3C6AE5C8}.Release|Any CPU.ActiveCfg = Release|Any CPU {B2E7865E-ECDE-4379-BD00-2F5A3C6AE5C8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap07/Commission Calculator Solution/Commission Calculator Project/App.config

Chap07/Commission Calculator Solution/Commission Calculator Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.lblCommission = New System.Windows.Forms.Label() Me.txtSales1 = New System.Windows.Forms.TextBox() Me.txtSales2 = New System.Windows.Forms.TextBox() Me.btnCalculate = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.txtSales3 = New System.Windows.Forms.TextBox() Me.SuspendLayout() ' 'lblCommission ' Me.lblCommission.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblCommission.Location = New System.Drawing.Point(21, 118) Me.lblCommission.Name = "lblCommission" Me.lblCommission.Size = New System.Drawing.Size(109, 29) Me.lblCommission.TabIndex = 9 Me.lblCommission.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'txtSales1 ' Me.txtSales1.Location = New System.Drawing.Point(21, 46) Me.txtSales1.Name = "txtSales1" Me.txtSales1.Size = New System.Drawing.Size(76, 25) Me.txtSales1.TabIndex = 1 ' 'txtSales2 ' Me.txtSales2.Location = New System.Drawing.Point(159, 46) Me.txtSales2.Name = "txtSales2" Me.txtSales2.Size = New System.Drawing.Size(76, 25) Me.txtSales2.TabIndex = 3 ' 'btnCalculate ' Me.btnCalculate.Location = New System.Drawing.Point(159, 110) Me.btnCalculate.Name = "btnCalculate" Me.btnCalculate.Size = New System.Drawing.Size(144, 37) Me.btnCalculate.TabIndex = 6 Me.btnCalculate.Text = "&Calculate Commission" Me.btnCalculate.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(319, 110) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(82, 37) Me.btnExit.TabIndex = 7 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(21, 25) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(76, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "&First month:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(159, 25) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(95, 17) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Second month:" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(21, 95) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(109, 17) Me.Label3.TabIndex = 8 Me.Label3.Text = "10% commission:" ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(319, 25) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(82, 17) Me.Label4.TabIndex = 4 Me.Label4.Text = "&Third month:" ' 'txtSales3 ' Me.txtSales3.Location = New System.Drawing.Point(319, 46) Me.txtSales3.Name = "txtSales3" Me.txtSales3.Size = New System.Drawing.Size(76, 25) Me.txtSales3.TabIndex = 5 ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(419, 182) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.txtSales3) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalculate) Me.Controls.Add(Me.txtSales2) Me.Controls.Add(Me.txtSales1) Me.Controls.Add(Me.lblCommission) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Quarterly Commission Calculator" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents lblCommission As System.Windows.Forms.Label Friend WithEvents txtSales1 As System.Windows.Forms.TextBox Friend WithEvents txtSales2 As System.Windows.Forms.TextBox Friend WithEvents btnCalculate As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents Label1 As System.Windows.Forms.Label 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 txtSales3 As System.Windows.Forms.TextBox End Class

Chap07/Commission Calculator Solution/Commission Calculator Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True

Chap07/Commission Calculator Solution/Commission Calculator Project/frmMain.vb

' Name: Commission Calculator Project ' Purpose: Display the quarterly commission ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click ' calculates and displays the quarterly commission ' declare named constant Const decRATE As Decimal = 0.1 ' declare variables Dim decSales1 As Decimal Dim decSales2 As Decimal Dim decSales3 As Decimal Dim decCommission As Decimal ' assign input to variables Decimal.TryParse(txtSales1, decSales1) Decimal.TryParse(txtSales2, decSales2) Decimal.TryParse(txtSales3, decSales3) ' calculate and display commission decCommission = decSales1 + decSales2 + decSales3 * decRATE lblCommission.Text = decCommission.ToString("C2") End Sub End Class

Chap07/Commission Calculator Solution/Commission Calculator Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap07/Commission Calculator Solution/Commission Calculator Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Commission Calculator Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("Commission Calculator Project")> <Assembly: AssemblyCopyright("Copyright © Toshiba 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("292874d5-361b-41ae-bfd1-af41dbb72020")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap07/Commission Calculator Solution/Commission Calculator Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Commission_Calculator_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap07/Commission Calculator Solution/Commission Calculator Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap07/Commission Calculator Solution/Commission Calculator Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Commission_Calculator_Project.My.MySettings Get Return Global.Commission_Calculator_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap07/Commission Calculator Solution/Commission Calculator Project/My Project/Settings.settings

Chap07/Commission Calculator Solution/Commission Calculator Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Commission Calculator Project", "Commission Calculator Project\Commission Calculator Project.vbproj", "{597A0934-59AD-4F59-B536-73B28FFA2460}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {597A0934-59AD-4F59-B536-73B28FFA2460}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {597A0934-59AD-4F59-B536-73B28FFA2460}.Debug|Any CPU.Build.0 = Debug|Any CPU {597A0934-59AD-4F59-B536-73B28FFA2460}.Release|Any CPU.ActiveCfg = Release|Any CPU {597A0934-59AD-4F59-B536-73B28FFA2460}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap07/Discount Solution/Discount Project/App.config

Chap07/Discount Solution/Discount Project/Discount Project.vbproj

Debug AnyCPU {84C1DDA4-C77E-427D-A254-EA28C550ADC6} WinExe Discount_Project.My.MyApplication Discount_Project Discount Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Discount Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Discount Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap07/Discount Solution/Discount Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.txtPrice = New System.Windows.Forms.TextBox() Me.lbl10 = New System.Windows.Forms.Label() Me.lbl20 = New System.Windows.Forms.Label() Me.lbl30 = New System.Windows.Forms.Label() Me.PictureBox3 = New System.Windows.Forms.PictureBox() Me.PictureBox2 = New System.Windows.Forms.PictureBox() Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(31, 47) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(44, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Price:" ' 'txtPrice ' Me.txtPrice.Location = New System.Drawing.Point(81, 44) Me.txtPrice.Name = "txtPrice" Me.txtPrice.Size = New System.Drawing.Size(100, 27) Me.txtPrice.TabIndex = 1 ' 'lbl10 ' Me.lbl10.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lbl10.Location = New System.Drawing.Point(35, 153) Me.lbl10.Name = "lbl10" Me.lbl10.Size = New System.Drawing.Size(100, 31) Me.lbl10.TabIndex = 5 Me.lbl10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'lbl20 ' Me.lbl20.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lbl20.Location = New System.Drawing.Point(141, 153) Me.lbl20.Name = "lbl20" Me.lbl20.Size = New System.Drawing.Size(100, 31) Me.lbl20.TabIndex = 6 Me.lbl20.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'lbl30 ' Me.lbl30.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lbl30.Location = New System.Drawing.Point(247, 153) Me.lbl30.Name = "lbl30" Me.lbl30.Size = New System.Drawing.Size(100, 31) Me.lbl30.TabIndex = 7 Me.lbl30.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'PictureBox3 ' Me.PictureBox3.Image = Global.Discount_Project.My.Resources.Resources._30Percent Me.PictureBox3.Location = New System.Drawing.Point(247, 96) Me.PictureBox3.Name = "PictureBox3" Me.PictureBox3.Size = New System.Drawing.Size(100, 50) Me.PictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox3.TabIndex = 4 Me.PictureBox3.TabStop = False ' 'PictureBox2 ' Me.PictureBox2.Image = Global.Discount_Project.My.Resources.Resources._20Percent Me.PictureBox2.Location = New System.Drawing.Point(141, 96) Me.PictureBox2.Name = "PictureBox2" Me.PictureBox2.Size = New System.Drawing.Size(100, 50) Me.PictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox2.TabIndex = 3 Me.PictureBox2.TabStop = False ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Discount_Project.My.Resources.Resources._10Percent Me.PictureBox1.Location = New System.Drawing.Point(35, 96) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(100, 50) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 2 Me.PictureBox1.TabStop = False ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(173, 212) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(93, 35) Me.btnCalc.TabIndex = 8 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(272, 212) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(75, 35) Me.btnExit.TabIndex = 9 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(387, 275) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lbl30) Me.Controls.Add(Me.lbl20) Me.Controls.Add(Me.lbl10) Me.Controls.Add(Me.PictureBox3) Me.Controls.Add(Me.PictureBox2) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.txtPrice) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Discount Calculator" CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtPrice As System.Windows.Forms.TextBox Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox Friend WithEvents PictureBox3 As System.Windows.Forms.PictureBox Friend WithEvents lbl10 As System.Windows.Forms.Label Friend WithEvents lbl20 As System.Windows.Forms.Label Friend WithEvents lbl30 As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap07/Discount Solution/Discount Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True

Chap07/Discount Solution/Discount Project/frmMain.vb

' Name: Discount Project ' Purpose: Display three discount amounts ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates and displays a 10%, 20%, and ' 30% discount on an item's price ' declare variables Dim decPrice As Decimal Dim decDiscount10 As Decimal Dim decDiscount20 As Decimal Dim decDiscount30 As Decimal ' calculate discounts decDiscount10 = decPrice * 0.1 decDiscount20 = decPrice * 0.2 decDiscount30 = decPrice * 0.3 ' display discounts lbl10.Text = decDiscount10.ToString("N2") lbl20.Text = decDiscount20.ToString("N2") lbl30.Text = decDiscount30.ToString("N2") End Sub End Class

Chap07/Discount Solution/Discount Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Discount_Project.frmMain End Sub End Class End Namespace

Chap07/Discount Solution/Discount Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap07/Discount Solution/Discount Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Discount Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Discount Project")> <Assembly: AssemblyCopyright("Copyright © 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("9c668957-6118-4ce6-81e7-c268c3040bfd")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap07/Discount Solution/Discount Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Discount_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property _10Percent() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("10Percent", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property _20Percent() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("20Percent", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property _30Percent() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("30Percent", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace

Chap07/Discount Solution/Discount Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\10Percent.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\20Percent.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\30Percent.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Chap07/Discount Solution/Discount Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Discount_Project.My.MySettings Get Return Global.Discount_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap07/Discount Solution/Discount Project/My Project/Settings.settings

Chap07/Discount Solution/Discount Project/Resources/10Percent.png

Chap07/Discount Solution/Discount Project/Resources/20Percent.png

Chap07/Discount Solution/Discount Project/Resources/30Percent.png

Chap07/Discount Solution/Discount Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Discount Project", "Discount Project\Discount Project.vbproj", "{84C1DDA4-C77E-427D-A254-EA28C550ADC6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {84C1DDA4-C77E-427D-A254-EA28C550ADC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {84C1DDA4-C77E-427D-A254-EA28C550ADC6}.Debug|Any CPU.Build.0 = Debug|Any CPU {84C1DDA4-C77E-427D-A254-EA28C550ADC6}.Release|Any CPU.ActiveCfg = Release|Any CPU {84C1DDA4-C77E-427D-A254-EA28C550ADC6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap07/Framington Solution/Framington Project/App.config

Chap07/Framington Solution/Framington Project/Framington Project.vbproj

Debug AnyCPU {3DED7205-8F58-45C2-A9FB-FCA745614A1C} WinExe Framington_Project.My.MyApplication Framington_Project Framington Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Framington Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Framington Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap07/Framington Solution/Framington Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.txtGuests = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.lblTable10 = New System.Windows.Forms.Label() Me.lblTable5 = New System.Windows.Forms.Label() Me.lblRemain = New System.Windows.Forms.Label() Me.btnDisplay = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(14, 27) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(130, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "Number of &guests:" ' 'txtGuests ' Me.txtGuests.Location = New System.Drawing.Point(154, 27) Me.txtGuests.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtGuests.Name = "txtGuests" Me.txtGuests.Size = New System.Drawing.Size(57, 27) Me.txtGuests.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(14, 95) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(98, 20) Me.Label2.TabIndex = 4 Me.Label2.Text = "Tables for 10:" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(139, 95) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(90, 20) Me.Label3.TabIndex = 5 Me.Label3.Text = "Tables for 5:" ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(259, 95) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(126, 20) Me.Label4.TabIndex = 6 Me.Label4.Text = "Guests remaining:" ' 'lblTable10 ' Me.lblTable10.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblTable10.Location = New System.Drawing.Point(18, 121) Me.lblTable10.Name = "lblTable10" Me.lblTable10.Size = New System.Drawing.Size(58, 36) Me.lblTable10.TabIndex = 7 Me.lblTable10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'lblTable5 ' Me.lblTable5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblTable5.Location = New System.Drawing.Point(146, 121) Me.lblTable5.Name = "lblTable5" Me.lblTable5.Size = New System.Drawing.Size(58, 36) Me.lblTable5.TabIndex = 8 Me.lblTable5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'lblRemain ' Me.lblRemain.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblRemain.Location = New System.Drawing.Point(264, 121) Me.lblRemain.Name = "lblRemain" Me.lblRemain.Size = New System.Drawing.Size(58, 36) Me.lblRemain.TabIndex = 9 Me.lblRemain.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnDisplay ' Me.btnDisplay.Location = New System.Drawing.Point(237, 18) Me.btnDisplay.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnDisplay.Name = "btnDisplay" Me.btnDisplay.Size = New System.Drawing.Size(86, 38) Me.btnDisplay.TabIndex = 2 Me.btnDisplay.Text = "&Display" Me.btnDisplay.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(329, 18) Me.btnExit.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(86, 38) Me.btnExit.TabIndex = 3 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(431, 194) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnDisplay) Me.Controls.Add(Me.lblRemain) Me.Controls.Add(Me.lblTable5) Me.Controls.Add(Me.lblTable10) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtGuests) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 6, 3, 6) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Framington Parties" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtGuests As System.Windows.Forms.TextBox 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 lblTable10 As System.Windows.Forms.Label Friend WithEvents lblTable5 As System.Windows.Forms.Label Friend WithEvents lblRemain As System.Windows.Forms.Label Friend WithEvents btnDisplay As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap07/Framington Solution/Framington Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True

Chap07/Framington Solution/Framington Project/frmMain.vb

' Name: Framington Project ' Purpose: Display the number of tables needed to ' seat guests at a party ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnDisplay_Click(sender As Object, e As EventArgs) Handles btnDisplay.Click ' calculates the number of tables that seat 10, the number ' of tables that seat 5, and the number of guests remaining ' example: 67 guests need 6 tables of 10 and 1 ' table of 5, with 2 guests remaining Dim intGuests As Integer Dim intTable10 As Integer Dim intTable5 As Integer Dim intRemain As Integer ' assign input to a variable Integer.TryParse(txtGuests.Text, intGuests) ' perform calculations intTable10 = intGuests / 10 intRemain = intGuests - intTable10 * 10 intTable5 = intRemain / 5 intRemain = intRemain - intTable5 * 5 ' display calculated results lblTable10.Text = intTable10 lblTable5.Text = intTable5 lblRemain.Text = intRemain End Sub Private Sub btnExit_Click(sender As Object, e As EventArgs) Me.Close() End Sub End Class

Chap07/Framington Solution/Framington Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Framington_Project.frmMain End Sub End Class End Namespace

Chap07/Framington Solution/Framington Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap07/Framington Solution/Framington Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Framington Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("Framington Project")> <Assembly: AssemblyCopyright("Copyright © Toshiba 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("03fe96d1-d2c4-4672-88f6-56fac8722f1f")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap07/Framington Solution/Framington Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Framington_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap07/Framington Solution/Framington Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap07/Framington Solution/Framington Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Framington_Project.My.MySettings Get Return Global.Framington_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap07/Framington Solution/Framington Project/My Project/Settings.settings

Chap07/Framington Solution/Framington Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Framington Project", "Framington Project\Framington Project.vbproj", "{3DED7205-8F58-45C2-A9FB-FCA745614A1C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {3DED7205-8F58-45C2-A9FB-FCA745614A1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3DED7205-8F58-45C2-A9FB-FCA745614A1C}.Debug|Any CPU.Build.0 = Debug|Any CPU {3DED7205-8F58-45C2-A9FB-FCA745614A1C}.Release|Any CPU.ActiveCfg = Release|Any CPU {3DED7205-8F58-45C2-A9FB-FCA745614A1C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap07/Hawkins Solution/Hawkins Project/App.config

Chap07/Hawkins Solution/Hawkins Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.btnExit = New System.Windows.Forms.Button() Me.btnCalc = New System.Windows.Forms.Button() Me.txtSpent = New System.Windows.Forms.TextBox() Me.txtEarned = New System.Windows.Forms.TextBox() Me.txtBegin = New System.Windows.Forms.TextBox() Me.lblEnding = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(186, 222) Me.btnExit.Margin = New System.Windows.Forms.Padding(2) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(103, 34) Me.btnExit.TabIndex = 7 Me.btnExit.Text = "E&xit" ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(186, 183) Me.btnCalc.Margin = New System.Windows.Forms.Padding(2) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(103, 34) Me.btnCalc.TabIndex = 6 Me.btnCalc.Text = "&Calculate" ' 'txtSpent ' Me.txtSpent.Location = New System.Drawing.Point(33, 158) Me.txtSpent.Margin = New System.Windows.Forms.Padding(2) Me.txtSpent.Name = "txtSpent" Me.txtSpent.Size = New System.Drawing.Size(131, 25) Me.txtSpent.TabIndex = 5 ' 'txtEarned ' Me.txtEarned.Location = New System.Drawing.Point(33, 96) Me.txtEarned.Margin = New System.Windows.Forms.Padding(2) Me.txtEarned.Name = "txtEarned" Me.txtEarned.Size = New System.Drawing.Size(131, 25) Me.txtEarned.TabIndex = 3 ' 'txtBegin ' Me.txtBegin.Location = New System.Drawing.Point(33, 39) Me.txtBegin.Margin = New System.Windows.Forms.Padding(2) Me.txtBegin.Name = "txtBegin" Me.txtBegin.Size = New System.Drawing.Size(131, 25) Me.txtBegin.TabIndex = 1 ' 'lblEnding ' Me.lblEnding.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblEnding.Location = New System.Drawing.Point(33, 222) Me.lblEnding.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.lblEnding.Name = "lblEnding" Me.lblEnding.Size = New System.Drawing.Size(131, 30) Me.lblEnding.TabIndex = 9 Me.lblEnding.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(29, 202) Me.Label4.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(100, 17) Me.Label4.TabIndex = 8 Me.Label4.Text = "Ending balance:" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(29, 136) Me.Label3.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(87, 17) Me.Label3.TabIndex = 4 Me.Label3.Text = "Money &spent:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(29, 75) Me.Label2.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(96, 17) Me.Label2.TabIndex = 2 Me.Label2.Text = "Money &earned:" ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(29, 17) Me.Label1.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(117, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Beginning balance:" ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(316, 280) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.txtSpent) Me.Controls.Add(Me.txtEarned) Me.Controls.Add(Me.txtBegin) Me.Controls.Add(Me.lblEnding) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Ending Balance Calculator" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents txtSpent As System.Windows.Forms.TextBox Friend WithEvents txtEarned As System.Windows.Forms.TextBox Friend WithEvents txtBegin As System.Windows.Forms.TextBox Friend WithEvents lblEnding As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label1 As System.Windows.Forms.Label End Class

Chap07/Hawkins Solution/Hawkins Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True

Chap07/Hawkins Solution/Hawkins Project/frmMain.vb

' Name: Hawkins Project ' Purpose: Display the ending balance ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates the ending balance based on the beginning ' balance, amount earned, and amount spent Dim decBegin As Decimal Dim decEarned As Decimal Dim decSpent As Decimal Dim decEnding As Decimal ' assign input to variables Decimal.TryParse(txtBegin.Text, decBegin) Decimal.TryParse(txtSpent.Text, decSpent) ' calculate and display ending balance decEnding = decBegin + decEarned - decSpent lblEnding = decEnding.ToString("C2") End Sub End Class

Chap07/Hawkins Solution/Hawkins Project/Hawkins Project.vbproj

Debug AnyCPU {3F30EEFA-A448-43F8-BFFA-033AAAB5B33D} WinExe Hawkins_Project.My.MyApplication Hawkins_Project Hawkins Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Hawkins Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Hawkins Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap07/Hawkins Solution/Hawkins Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Hawkins_Project.frmMain End Sub End Class End Namespace

Chap07/Hawkins Solution/Hawkins Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap07/Hawkins Solution/Hawkins Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Hawkins Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("Hawkins Project")> <Assembly: AssemblyCopyright("Copyright © Toshiba 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("5f0b4d35-fd62-4974-a59c-1a2c580e932d")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap07/Hawkins Solution/Hawkins Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Hawkins_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap07/Hawkins Solution/Hawkins Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap07/Hawkins Solution/Hawkins Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Hawkins_Project.My.MySettings Get Return Global.Hawkins_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap07/Hawkins Solution/Hawkins Project/My Project/Settings.settings

Chap07/Hawkins Solution/Hawkins Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Hawkins Project", "Hawkins Project\Hawkins Project.vbproj", "{3F30EEFA-A448-43F8-BFFA-033AAAB5B33D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {3F30EEFA-A448-43F8-BFFA-033AAAB5B33D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3F30EEFA-A448-43F8-BFFA-033AAAB5B33D}.Debug|Any CPU.Build.0 = Debug|Any CPU {3F30EEFA-A448-43F8-BFFA-033AAAB5B33D}.Release|Any CPU.ActiveCfg = Release|Any CPU {3F30EEFA-A448-43F8-BFFA-033AAAB5B33D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap07/Hours Worked Solution/Hours Worked Project/App.config

Chap07/Hours Worked Solution/Hours Worked Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.lblTotal = New System.Windows.Forms.Label() Me.txtWeek1 = New System.Windows.Forms.TextBox() Me.txtWeek2 = New System.Windows.Forms.TextBox() Me.txtWeek3 = New System.Windows.Forms.TextBox() Me.txtWeek4 = New System.Windows.Forms.TextBox() Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(133, 37) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(61, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "Week &1:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(133, 84) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(61, 20) Me.Label2.TabIndex = 2 Me.Label2.Text = "Week &2:" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(133, 131) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(61, 20) Me.Label3.TabIndex = 4 Me.Label3.Text = "Week &3:" ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(133, 178) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(61, 20) Me.Label4.TabIndex = 6 Me.Label4.Text = "Week &4:" ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Location = New System.Drawing.Point(133, 225) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(46, 20) Me.Label5.TabIndex = 10 Me.Label5.Text = "Total:" ' 'lblTotal ' Me.lblTotal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblTotal.Location = New System.Drawing.Point(185, 224) Me.lblTotal.Name = "lblTotal" Me.lblTotal.Size = New System.Drawing.Size(67, 32) Me.lblTotal.TabIndex = 11 Me.lblTotal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'txtWeek1 ' Me.txtWeek1.Location = New System.Drawing.Point(200, 34) Me.txtWeek1.Name = "txtWeek1" Me.txtWeek1.Size = New System.Drawing.Size(52, 27) Me.txtWeek1.TabIndex = 1 ' 'txtWeek2 ' Me.txtWeek2.Location = New System.Drawing.Point(200, 81) Me.txtWeek2.Name = "txtWeek2" Me.txtWeek2.Size = New System.Drawing.Size(52, 27) Me.txtWeek2.TabIndex = 3 ' 'txtWeek3 ' Me.txtWeek3.Location = New System.Drawing.Point(200, 128) Me.txtWeek3.Name = "txtWeek3" Me.txtWeek3.Size = New System.Drawing.Size(52, 27) Me.txtWeek3.TabIndex = 5 ' 'txtWeek4 ' Me.txtWeek4.Location = New System.Drawing.Point(200, 175) Me.txtWeek4.Name = "txtWeek4" Me.txtWeek4.Size = New System.Drawing.Size(52, 27) Me.txtWeek4.TabIndex = 7 ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Hours_Worked_Project.My.Resources.Resources.Clock Me.PictureBox1.Location = New System.Drawing.Point(12, 12) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(91, 99) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 10 Me.PictureBox1.TabStop = False ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(277, 33) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(90, 29) Me.btnCalc.TabIndex = 8 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(277, 68) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(90, 29) Me.btnExit.TabIndex = 9 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(385, 279) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.txtWeek4) Me.Controls.Add(Me.txtWeek3) Me.Controls.Add(Me.txtWeek2) Me.Controls.Add(Me.txtWeek1) Me.Controls.Add(Me.lblTotal) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Hours Worked" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label 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 lblTotal As System.Windows.Forms.Label Friend WithEvents txtWeek1 As System.Windows.Forms.TextBox Friend WithEvents txtWeek2 As System.Windows.Forms.TextBox Friend WithEvents txtWeek3 As System.Windows.Forms.TextBox Friend WithEvents txtWeek4 As System.Windows.Forms.TextBox Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap07/Hours Worked Solution/Hours Worked Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True True True True

Chap07/Hours Worked Solution/Hours Worked Project/frmMain.vb

' Name: Hours Worked Project ' Purpose: Display the total hours worked ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates and displays the total number ' of hours worked during 4 weeks ' declare variables Dim dblWeek1 As Double Dim dblWeek2 As Double Dim dblWeek3 As Double Dim dblWeek4 As Double Dim dblTotal As Double ' assign input to variables Double.TryParse(txtWeek1.Text, dblWeek1) Double.TryParse(txtWeek2.Text, dblWeek2) Double.TryParse(txtWeek3.Text, dblWeek2) Double.TryParse(txtWeek4.Text, dblWeek4) ' calculate total hours worked dblTotal = dblWeek1 + dblWeek2 + dblWeek3 + dblWeek4 ' display total hours worked lblTotal.Text = dblTotal End Sub End Class

Chap07/Hours Worked Solution/Hours Worked Project/Hours Worked Project.vbproj

Debug AnyCPU {5B071145-EDD7-4876-BC5E-DC1B573D80F2} WinExe Hours_Worked_Project.My.MyApplication Hours_Worked_Project Hours Worked Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Hours Worked Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Hours Worked Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap07/Hours Worked Solution/Hours Worked Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Hours_Worked_Project.frmMain End Sub End Class End Namespace

Chap07/Hours Worked Solution/Hours Worked Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap07/Hours Worked Solution/Hours Worked Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Hours Worked Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Hours Worked Project")> <Assembly: AssemblyCopyright("Copyright © 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("d93c63f1-2cdc-4ede-b613-41bbb4393330")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap07/Hours Worked Solution/Hours Worked Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Hours_Worked_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property Clock() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Clock", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace

Chap07/Hours Worked Solution/Hours Worked Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\Clock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Chap07/Hours Worked Solution/Hours Worked Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Hours_Worked_Project.My.MySettings Get Return Global.Hours_Worked_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap07/Hours Worked Solution/Hours Worked Project/My Project/Settings.settings

Chap07/Hours Worked Solution/Hours Worked Project/Resources/Clock.png

Chap07/Hours Worked Solution/Hours Worked Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Hours Worked Project", "Hours Worked Project\Hours Worked Project.vbproj", "{5B071145-EDD7-4876-BC5E-DC1B573D80F2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {5B071145-EDD7-4876-BC5E-DC1B573D80F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5B071145-EDD7-4876-BC5E-DC1B573D80F2}.Debug|Any CPU.Build.0 = Debug|Any CPU {5B071145-EDD7-4876-BC5E-DC1B573D80F2}.Release|Any CPU.ActiveCfg = Release|Any CPU {5B071145-EDD7-4876-BC5E-DC1B573D80F2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap07/Martins Solution/Martins Project/App.config

Chap07/Martins Solution/Martins Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.lblGainLoss = New System.Windows.Forms.Label() Me.txtName = New System.Windows.Forms.TextBox() Me.txtShares = New System.Windows.Forms.TextBox() Me.txtOpening = New System.Windows.Forms.TextBox() Me.txtClosing = New System.Windows.Forms.TextBox() Me.btnGainLoss = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(84, 20) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(78, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "Stock &name:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(222, 20) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(50, 17) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Shares:" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(84, 80) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(94, 17) Me.Label3.TabIndex = 4 Me.Label3.Text = "&Opening price:" ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(218, 80) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(87, 17) Me.Label4.TabIndex = 6 Me.Label4.Text = "&Closing price:" ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Location = New System.Drawing.Point(25, 140) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(75, 17) Me.Label5.TabIndex = 10 Me.Label5.Text = "Gain (Loss):" ' 'lblGainLoss ' Me.lblGainLoss.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblGainLoss.Location = New System.Drawing.Point(29, 160) Me.lblGainLoss.Name = "lblGainLoss" Me.lblGainLoss.Size = New System.Drawing.Size(100, 30) Me.lblGainLoss.TabIndex = 11 Me.lblGainLoss.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'txtName ' Me.txtName.Location = New System.Drawing.Point(84, 39) Me.txtName.Name = "txtName" Me.txtName.Size = New System.Drawing.Size(87, 25) Me.txtName.TabIndex = 1 ' 'txtShares ' Me.txtShares.Location = New System.Drawing.Point(222, 39) Me.txtShares.Name = "txtShares" Me.txtShares.Size = New System.Drawing.Size(87, 25) Me.txtShares.TabIndex = 3 ' 'txtOpening ' Me.txtOpening.Location = New System.Drawing.Point(84, 100) Me.txtOpening.Name = "txtOpening" Me.txtOpening.Size = New System.Drawing.Size(87, 25) Me.txtOpening.TabIndex = 5 ' 'txtClosing ' Me.txtClosing.Location = New System.Drawing.Point(218, 100) Me.txtClosing.Name = "txtClosing" Me.txtClosing.Size = New System.Drawing.Size(87, 25) Me.txtClosing.TabIndex = 7 ' 'btnGainLoss ' Me.btnGainLoss.Location = New System.Drawing.Point(145, 152) Me.btnGainLoss.Name = "btnGainLoss" Me.btnGainLoss.Size = New System.Drawing.Size(157, 41) Me.btnGainLoss.TabIndex = 8 Me.btnGainLoss.Text = "Calculate &Gain/(Loss)" Me.btnGainLoss.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(308, 152) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(75, 41) Me.btnExit.TabIndex = 9 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(407, 224) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnGainLoss) Me.Controls.Add(Me.txtClosing) Me.Controls.Add(Me.txtOpening) Me.Controls.Add(Me.txtShares) Me.Controls.Add(Me.txtName) Me.Controls.Add(Me.lblGainLoss) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Martins Gain/Loss Calculator" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label 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 lblGainLoss As System.Windows.Forms.Label Friend WithEvents txtName As System.Windows.Forms.TextBox Friend WithEvents txtShares As System.Windows.Forms.TextBox Friend WithEvents txtOpening As System.Windows.Forms.TextBox Friend WithEvents txtClosing As System.Windows.Forms.TextBox Friend WithEvents btnGainLoss As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap07/Martins Solution/Martins Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True True True

Chap07/Martins Solution/Martins Project/frmMain.vb

' Name: Martins Project ' Purpose: Display the gain or loss on a stock ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnGainLoss_Click(sender As Object, e As EventArgs) Handles btnGainLoss.Click ' calculates and displays the gain or loss on a stock Dim intShares As Integer Dim decOpenPrice As Decimal Dim decClosePrice As Decimal Dim decGainLoss As Decimal ' assign input to variables Integer.TryParse(txtShares.Text, intShares) Decimal.TryParse(txtOpening.Text, decClosePrice) Decimal.TryParse(txtClosing.Text, decClosePrice) ' calculate and display gain or loss decGainLoss = decClosePrice - decOpenPrice * intShares lblGainLoss.Text = decGainLoss.ToString("C2") End Sub End Class

Chap07/Martins Solution/Martins Project/Martins Project.vbproj

Debug AnyCPU {57663EFF-BEC8-402C-9FA8-356BAF906774} WinExe Martins_Project.My.MyApplication Martins_Project Martins Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Martins Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Martins Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap07/Martins Solution/Martins Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Martins_Project.frmMain End Sub End Class End Namespace

Chap07/Martins Solution/Martins Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap07/Martins Solution/Martins Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Martins Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("Martins Project")> <Assembly: AssemblyCopyright("Copyright © Toshiba 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("266feb14-38ea-47f5-90d6-00980e39496f")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap07/Martins Solution/Martins Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Martins_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap07/Martins Solution/Martins Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap07/Martins Solution/Martins Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Martins_Project.My.MySettings Get Return Global.Martins_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap07/Martins Solution/Martins Project/My Project/Settings.settings

Chap07/Martins Solution/Martins Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Martins Project", "Martins Project\Martins Project.vbproj", "{57663EFF-BEC8-402C-9FA8-356BAF906774}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {57663EFF-BEC8-402C-9FA8-356BAF906774}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {57663EFF-BEC8-402C-9FA8-356BAF906774}.Debug|Any CPU.Build.0 = Debug|Any CPU {57663EFF-BEC8-402C-9FA8-356BAF906774}.Release|Any CPU.ActiveCfg = Release|Any CPU {57663EFF-BEC8-402C-9FA8-356BAF906774}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap07/New Pay Solution/New Pay Project/App.config

Chap07/New Pay Solution/New Pay Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.txtCurrentPay = New System.Windows.Forms.TextBox() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.lblNewPay = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(33, 23) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(121, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "Current weekly &pay:" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(33, 66) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(104, 17) Me.Label3.TabIndex = 4 Me.Label3.Text = "New weekly pay:" ' 'txtCurrentPay ' Me.txtCurrentPay.Location = New System.Drawing.Point(160, 20) Me.txtCurrentPay.Name = "txtCurrentPay" Me.txtCurrentPay.Size = New System.Drawing.Size(70, 25) Me.txtCurrentPay.TabIndex = 1 ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(252, 20) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(84, 33) Me.btnCalc.TabIndex = 2 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(252, 59) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(84, 33) Me.btnExit.TabIndex = 3 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'lblNewPay ' Me.lblNewPay.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblNewPay.Location = New System.Drawing.Point(143, 65) Me.lblNewPay.Name = "lblNewPay" Me.lblNewPay.Size = New System.Drawing.Size(88, 27) Me.lblNewPay.TabIndex = 5 Me.lblNewPay.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(370, 121) Me.Controls.Add(Me.lblNewPay) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.txtCurrentPay) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "New Pay" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents txtCurrentPay As System.Windows.Forms.TextBox Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents lblNewPay As System.Windows.Forms.Label End Class

Chap07/New Pay Solution/New Pay Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True

Chap07/New Pay Solution/New Pay Project/frmMain.vb

' Name: New Pay Project ' Purpose: Display the new weekly pay ' Programmmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates and displays the new weekly pay ' using a raise rate of 3% Const dblRATE As Double = 0.3 Dim dblNewPay As Decimal Dim dblCurrentPay As Decimal Double.TryParse(txtCurrentPay.Text, dblCurrentPay) dblNewPay = dblCurrentPay + dblRATE * dblNewPay lblNewPay.Text = dblNewPay.ToString("C2") End Sub End Class

Chap07/New Pay Solution/New Pay Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.New_Pay_Project.frmMain End Sub End Class End Namespace

Chap07/New Pay Solution/New Pay Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap07/New Pay Solution/New Pay Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("New Pay Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("New Pay Project")> <Assembly: AssemblyCopyright("Copyright © Toshiba 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("3ddae6f8-9257-4d7e-9405-86f574d6d86a")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap07/New Pay Solution/New Pay Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("New_Pay_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace

Chap07/New Pay Solution/New Pay Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Chap07/New Pay Solution/New Pay Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.New_Pay_Project.My.MySettings Get Return Global.New_Pay_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap07/New Pay Solution/New Pay Project/My Project/Settings.settings

Chap07/New Pay Solution/New Pay Project/New Pay Project.vbproj

Debug AnyCPU {E458F734-18B2-4104-B402-CD8D49E1CC08} WinExe New_Pay_Project.My.MyApplication New_Pay_Project New Pay Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ New Pay Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ New Pay Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap07/New Pay Solution/New Pay Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "New Pay Project", "New Pay Project\New Pay Project.vbproj", "{E458F734-18B2-4104-B402-CD8D49E1CC08}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E458F734-18B2-4104-B402-CD8D49E1CC08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E458F734-18B2-4104-B402-CD8D49E1CC08}.Debug|Any CPU.Build.0 = Debug|Any CPU {E458F734-18B2-4104-B402-CD8D49E1CC08}.Release|Any CPU.ActiveCfg = Release|Any CPU {E458F734-18B2-4104-B402-CD8D49E1CC08}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap07/Quotient Solution/Quotient Project/App.config

Chap07/Quotient Solution/Quotient Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.txtNumerator = New System.Windows.Forms.TextBox() Me.txtDenominator = New System.Windows.Forms.TextBox() Me.lblQuotient = New System.Windows.Forms.Label() Me.PictureBox2 = New System.Windows.Forms.PictureBox() Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'txtNumerator ' Me.txtNumerator.Location = New System.Drawing.Point(34, 62) Me.txtNumerator.Name = "txtNumerator" Me.txtNumerator.Size = New System.Drawing.Size(58, 27) Me.txtNumerator.TabIndex = 0 ' 'txtDenominator ' Me.txtDenominator.Location = New System.Drawing.Point(201, 62) Me.txtDenominator.Name = "txtDenominator" Me.txtDenominator.Size = New System.Drawing.Size(58, 27) Me.txtDenominator.TabIndex = 1 ' 'lblQuotient ' Me.lblQuotient.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblQuotient.Location = New System.Drawing.Point(377, 62) Me.lblQuotient.Name = "lblQuotient" Me.lblQuotient.Size = New System.Drawing.Size(87, 27) Me.lblQuotient.TabIndex = 4 Me.lblQuotient.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'PictureBox2 ' Me.PictureBox2.Image = Global.Quotient_Project.My.Resources.Resources.Equals Me.PictureBox2.Location = New System.Drawing.Point(279, 49) Me.PictureBox2.Name = "PictureBox2" Me.PictureBox2.Size = New System.Drawing.Size(82, 77) Me.PictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox2.TabIndex = 5 Me.PictureBox2.TabStop = False ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Quotient_Project.My.Resources.Resources.DividedBy Me.PictureBox1.Location = New System.Drawing.Point(108, 53) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(77, 50) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 2 Me.PictureBox1.TabStop = False ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(284, 152) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(87, 31) Me.btnCalc.TabIndex = 2 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(377, 152) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(87, 31) Me.btnExit.TabIndex = 3 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(495, 218) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblQuotient) Me.Controls.Add(Me.PictureBox2) Me.Controls.Add(Me.txtDenominator) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.txtNumerator) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Quotient Calculator" CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents txtNumerator As System.Windows.Forms.TextBox Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents txtDenominator As System.Windows.Forms.TextBox Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox Friend WithEvents lblQuotient As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap07/Quotient Solution/Quotient Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True

Chap07/Quotient Solution/Quotient Project/frmMain.vb

' Name: Quotient Project ' Purpose: Divide two numbers and display the quotient ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' display the result of dividing two numbers Dim decNumerator As Decimal Dim decDenominator As Decimal Dim decQuotient As Decimal Decimal.TryParse(txtNumerator.Text, decNumerator) Decimal.TryParse(txtDenominator.Text, decDenominator) decQuotient = decNumerator / decDenominator lblQuotient.Text = decQuotient.ToString("N2") End Sub End Class

Chap07/Quotient Solution/Quotient Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Quotient_Project.frmMain End Sub End Class End Namespace

Chap07/Quotient Solution/Quotient Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap07/Quotient Solution/Quotient Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Quotient Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Quotient Project")> <Assembly: AssemblyCopyright("Copyright © 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("11b7c978-ef63-4561-a27c-07038cc8952d")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap07/Quotient Solution/Quotient Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Quotient_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property DividedBy() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("DividedBy", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property Equals() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Equals", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace

Chap07/Quotient Solution/Quotient Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\DividedBy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Equals.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Chap07/Quotient Solution/Quotient Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Quotient_Project.My.MySettings Get Return Global.Quotient_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap07/Quotient Solution/Quotient Project/My Project/Settings.settings

Chap07/Quotient Solution/Quotient Project/Quotient Project.vbproj

Debug AnyCPU {9C597123-E964-4593-957B-33E53224761F} WinExe Quotient_Project.My.MyApplication Quotient_Project Quotient Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Quotient Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Quotient Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap07/Quotient Solution/Quotient Project/Resources/DividedBy.png

Chap07/Quotient Solution/Quotient Project/Resources/Equals.png

Chap07/Quotient Solution/Quotient Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Quotient Project", "Quotient Project\Quotient Project.vbproj", "{9C597123-E964-4593-957B-33E53224761F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {9C597123-E964-4593-957B-33E53224761F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9C597123-E964-4593-957B-33E53224761F}.Debug|Any CPU.Build.0 = Debug|Any CPU {9C597123-E964-4593-957B-33E53224761F}.Release|Any CPU.ActiveCfg = Release|Any CPU {9C597123-E964-4593-957B-33E53224761F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap07/Total Sales Solution/Total Sales Project/App.config

Chap07/Total Sales Solution/Total Sales Project/frmMain.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain 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 '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. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.txtJack = New System.Windows.Forms.TextBox() Me.txtMary = New System.Windows.Forms.TextBox() Me.txtKhalid = New System.Windows.Forms.TextBox() Me.txtSharon = New System.Windows.Forms.TextBox() Me.Label5 = New System.Windows.Forms.Label() Me.lblTotal = New System.Windows.Forms.Label() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.Label6 = New System.Windows.Forms.Label() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(199, 30) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(84, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Jack's sales:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(199, 63) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(90, 20) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Mary's sales:" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(199, 99) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(99, 20) Me.Label3.TabIndex = 4 Me.Label3.Text = "&Khalid's sales:" ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(199, 134) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(103, 20) Me.Label4.TabIndex = 6 Me.Label4.Text = "&Sharon's sales:" ' 'txtJack ' Me.txtJack.Location = New System.Drawing.Point(308, 27) Me.txtJack.Name = "txtJack" Me.txtJack.Size = New System.Drawing.Size(100, 27) Me.txtJack.TabIndex = 1 ' 'txtMary ' Me.txtMary.Location = New System.Drawing.Point(308, 60) Me.txtMary.Name = "txtMary" Me.txtMary.Size = New System.Drawing.Size(100, 27) Me.txtMary.TabIndex = 3 ' 'txtKhalid ' Me.txtKhalid.Location = New System.Drawing.Point(308, 96) Me.txtKhalid.Name = "txtKhalid" Me.txtKhalid.Size = New System.Drawing.Size(100, 27) Me.txtKhalid.TabIndex = 5 ' 'txtSharon ' Me.txtSharon.Location = New System.Drawing.Point(308, 131) Me.txtSharon.Name = "txtSharon" Me.txtSharon.Size = New System.Drawing.Size(100, 27) Me.txtSharon.TabIndex = 7 ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Location = New System.Drawing.Point(199, 185) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(82, 20) Me.Label5.TabIndex = 11 Me.Label5.Text = "Total sales:" ' 'lblTotal ' Me.lblTotal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblTotal.Location = New System.Drawing.Point(308, 184) Me.lblTotal.Name = "lblTotal" Me.lblTotal.Size = New System.Drawing.Size(100, 27) Me.lblTotal.TabIndex = 12 ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(203, 225) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(100, 32) Me.btnCalc.TabIndex = 8 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(309, 225) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(99, 32) Me.btnExit.TabIndex = 9 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Total_Sales_Project.My.Resources.Resources.Realtor Me.PictureBox1.Location = New System.Drawing.Point(34, 12) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(107, 111) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 12 Me.PictureBox1.TabStop = False ' 'Label6 ' Me.Label6.AutoSize = True Me.Label6.Font = New System.Drawing.Font("SketchFlow Print", 15.75!, CType((System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Italic), System.Drawing.FontStyle), System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label6.Location = New System.Drawing.Point(9, 131) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(163, 23) Me.Label6.TabIndex = 10 Me.Label6.Text = "Carrie Realty" ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(440, 284) Me.Controls.Add(Me.Label6) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblTotal) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.txtSharon) Me.Controls.Add(Me.txtKhalid) Me.Controls.Add(Me.txtMary) Me.Controls.Add(Me.txtJack) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Total Sales Calculator" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label 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 txtJack As System.Windows.Forms.TextBox Friend WithEvents txtMary As System.Windows.Forms.TextBox Friend WithEvents txtKhalid As System.Windows.Forms.TextBox Friend WithEvents txtSharon As System.Windows.Forms.TextBox Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents lblTotal As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents Label6 As System.Windows.Forms.Label End Class

Chap07/Total Sales Solution/Total Sales Project/frmMain.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True True True True True

Chap07/Total Sales Solution/Total Sales Project/frmMain.vb

' Name: Total Sales Project ' Purpose: Display the total sales ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates and displays the total sales ' declare variables Dim intJack As Integer Dim intMary As Integer Dim intKhalid As Integer Dim intSharon As Integer Dim intTotal As Intger ' assign input to variables Integer.TryParse(txtJack.Text, intJack Integer.TryParse(txtMary.Text, intMary) Integer.TryParse(txtKhalid.Text, intKhalid) Integer.TryParse(txtSharon.Text, intSharon) ' calculate total sales inTotal = intJack + intMary + intKhalid + intSharon ' display total sales lblTotal.Text = intTotal.ToString("C0") End Sub End Class

Chap07/Total Sales Solution/Total Sales Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Total_Sales_Project.frmMain End Sub End Class End Namespace

Chap07/Total Sales Solution/Total Sales Project/My Project/Application.myapp

<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>

Chap07/Total Sales Solution/Total Sales Project/My Project/AssemblyInfo.vb

Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Total Sales Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Total Sales Project")> <Assembly: AssemblyCopyright("Copyright © 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("e01ec5c9-4b5e-4430-b517-e4b8b27b2c93")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

Chap07/Total Sales Solution/Total Sales Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Total_Sales_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property Realtor() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Realtor", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace

Chap07/Total Sales Solution/Total Sales Project/My Project/Resources.resx

text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\Realtor.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Chap07/Total Sales Solution/Total Sales Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.17929 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Total_Sales_Project.My.MySettings Get Return Global.Total_Sales_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap07/Total Sales Solution/Total Sales Project/My Project/Settings.settings

Chap07/Total Sales Solution/Total Sales Project/Resources/Realtor.png

Chap07/Total Sales Solution/Total Sales Project/Total Sales Project.vbproj

Debug AnyCPU {4BFC2054-841B-4DAB-BA5C-AF16BE1BBCCF} WinExe Total_Sales_Project.My.MyApplication Total_Sales_Project Total Sales Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Total Sales Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Total Sales Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb

Chap07/Total Sales Solution/Total Sales Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Total Sales Project", "Total Sales Project\Total Sales Project.vbproj", "{4BFC2054-841B-4DAB-BA5C-AF16BE1BBCCF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {4BFC2054-841B-4DAB-BA5C-AF16BE1BBCCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4BFC2054-841B-4DAB-BA5C-AF16BE1BBCCF}.Debug|Any CPU.Build.0 = Debug|Any CPU {4BFC2054-841B-4DAB-BA5C-AF16BE1BBCCF}.Release|Any CPU.ActiveCfg = Release|Any CPU {4BFC2054-841B-4DAB-BA5C-AF16BE1BBCCF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal