visual basic

profileqboirtteu984
unitvii_studentfiles.zip

Chap11/ABC Solution/ABC Project/ABC Project.vbproj

Debug AnyCPU {B90EA7D8-DDC3-40F5-B1FC-FADFF0898CC1} WinExe ABC_Project.My.MyApplication ABC_Project ABC Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ ABC Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ ABC 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

Chap11/ABC Solution/ABC Project/App.config

Chap11/ABC Solution/ABC 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.lblPrice = New System.Windows.Forms.Label() Me.txtNumOrdered = New System.Windows.Forms.TextBox() Me.btnDisplayPrice = 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(46, 21) Me.Label1.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(130, 21) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Number ordered:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(46, 67) Me.Label2.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(109, 21) Me.Label2.TabIndex = 4 Me.Label2.Text = "Price per item:" ' 'lblPrice ' Me.lblPrice.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblPrice.Location = New System.Drawing.Point(164, 65) Me.lblPrice.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.lblPrice.Name = "lblPrice" Me.lblPrice.Size = New System.Drawing.Size(86, 26) Me.lblPrice.TabIndex = 5 Me.lblPrice.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'txtNumOrdered ' Me.txtNumOrdered.Location = New System.Drawing.Point(189, 18) Me.txtNumOrdered.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.txtNumOrdered.Name = "txtNumOrdered" Me.txtNumOrdered.Size = New System.Drawing.Size(61, 29) Me.txtNumOrdered.TabIndex = 1 ' 'btnDisplayPrice ' Me.btnDisplayPrice.Location = New System.Drawing.Point(50, 126) Me.btnDisplayPrice.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.btnDisplayPrice.Name = "btnDisplayPrice" Me.btnDisplayPrice.Size = New System.Drawing.Size(123, 34) Me.btnDisplayPrice.TabIndex = 2 Me.btnDisplayPrice.Text = "&Display Price" ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(180, 126) Me.btnExit.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(71, 34) Me.btnExit.TabIndex = 3 Me.btnExit.Text = "E&xit" ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 21.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(297, 182) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnDisplayPrice) Me.Controls.Add(Me.txtNumOrdered) Me.Controls.Add(Me.lblPrice) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.MaximizeBox = False Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "ABC Corporation" 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 lblPrice As System.Windows.Forms.Label Friend WithEvents txtNumOrdered As System.Windows.Forms.TextBox Friend WithEvents btnDisplayPrice As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap11/ABC Solution/ABC 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

Chap11/ABC Solution/ABC Project/frmMain.vb

' Name: ABC Project ' Purpose: Display the price per item ' 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 btnDisplayPrice_Click(sender As Object, e As EventArgs) Handles btnDisplayPrice.Click ' displays the price per item Dim intNumOrdered As Integer Dim intPrice As Integer ' assign number ordered to a variable Integer.TryParse(txtNumOrdered.Text, intNumOrdered) ' determine the price per item, using the following info: ' items ordered price ' from 1 through 5 $25 ' from 6 through 10 $23 ' over 10 $20 Select Case intNumOrdered Case 1 To 5 intPrice = 25 Case 6 To 10 intPrice = 23 Case Else intPrice = 20 End Select ' display the price per item lblPrice.Text = intPrice.ToString("C0") End Sub End Class

Chap11/ABC Solution/ABC Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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.ABC_Project.frmMain End Sub End Class End Namespace

Chap11/ABC Solution/ABC 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>

Chap11/ABC Solution/ABC 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("ABC Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("ABC Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("bd62dc46-45ff-4373-8c46-c2be1eaa2d6b")> ' 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")>

Chap11/ABC Solution/ABC Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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("ABC_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

Chap11/ABC Solution/ABC 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

Chap11/ABC Solution/ABC Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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.ABC_Project.My.MySettings Get Return Global.ABC_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/ABC Solution/ABC Project/My Project/Settings.settings

Chap11/ABC Solution/ABC Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ABC Project", "ABC Project\ABC Project.vbproj", "{B90EA7D8-DDC3-40F5-B1FC-FADFF0898CC1}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {B90EA7D8-DDC3-40F5-B1FC-FADFF0898CC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B90EA7D8-DDC3-40F5-B1FC-FADFF0898CC1}.Debug|Any CPU.Build.0 = Debug|Any CPU {B90EA7D8-DDC3-40F5-B1FC-FADFF0898CC1}.Release|Any CPU.ActiveCfg = Release|Any CPU {B90EA7D8-DDC3-40F5-B1FC-FADFF0898CC1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/Average Solution/Average Project/App.config

Chap11/Average Solution/Average Project/Average Project.vbproj

Debug AnyCPU {E003054F-192E-4550-8C52-1E06B0663723} WinExe Average_Project.My.MyApplication Average_Project Average Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Average Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Average 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

Chap11/Average Solution/Average 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.txtTest1 = New System.Windows.Forms.TextBox() Me.txtTest2 = New System.Windows.Forms.TextBox() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.Label3 = New System.Windows.Forms.Label() Me.lblAverage = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(32, 38) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(51, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "Test &1:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(123, 38) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(51, 20) Me.Label2.TabIndex = 2 Me.Label2.Text = "Test &2:" ' 'txtTest1 ' Me.txtTest1.Location = New System.Drawing.Point(37, 61) Me.txtTest1.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtTest1.Name = "txtTest1" Me.txtTest1.Size = New System.Drawing.Size(57, 27) Me.txtTest1.TabIndex = 1 ' 'txtTest2 ' Me.txtTest2.Location = New System.Drawing.Point(128, 61) Me.txtTest2.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtTest2.Name = "txtTest2" Me.txtTest2.Size = New System.Drawing.Size(57, 27) Me.txtTest2.TabIndex = 3 ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(37, 148) Me.btnCalc.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(168, 47) Me.btnCalc.TabIndex = 4 Me.btnCalc.Text = "&Calculate Average" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(215, 148) Me.btnExit.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(86, 47) Me.btnExit.TabIndex = 5 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(224, 38) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(67, 20) Me.Label3.TabIndex = 6 Me.Label3.Text = "Average:" ' 'lblAverage ' Me.lblAverage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblAverage.Location = New System.Drawing.Point(229, 61) Me.lblAverage.Name = "lblAverage" Me.lblAverage.Size = New System.Drawing.Size(72, 27) Me.lblAverage.TabIndex = 7 Me.lblAverage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(337, 232) Me.Controls.Add(Me.lblAverage) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.txtTest2) Me.Controls.Add(Me.txtTest1) 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(3, 6, 3, 6) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Average 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 txtTest1 As System.Windows.Forms.TextBox Friend WithEvents txtTest2 As System.Windows.Forms.TextBox Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents lblAverage As System.Windows.Forms.Label End Class

Chap11/Average Solution/Average 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

Chap11/Average Solution/Average Project/frmMain.vb

' Name: Average Project ' Purpose: Display the average of two test scores ' 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 ' Test data Expected result ' no data entered message, 0.0 ' test 1 is 50, test 2 is 0 25.0 ' test 1 is 50, test 2 is 40 45.0 ' test 1 is 50, test 2 is 100 75.0 ' test 1 is 50, test 2 is 47 48.5 ' test 1 is 0, test 2 is 50 25.0 ' test 1 is 40, test 2 is 50 45.0 ' test 1 is 100, test 2 is 50 75.0 ' test 1 is 47, test 2 is 50 48.5 ' test 1 is 95, test 2 is empty message, 0.0 ' test 1 is empty, test 2 is 70 message, 0.0 Dim intTest1 As Integer Dim intTest2 As Integer Dim decAverage As Decimal ' assign test scores to variables Integer.TryParse(txtTest1.Text, intTest1) Integer.TryParse(txtTest2.Text, intTest2) ' calculate and display average decAverage = intTest1 + intTest2 / 2 lblAverage.Text = decAverage.ToString("N1") End Sub Private Sub txtTest1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtTest1.KeyPress ' allows the text box to accept only numbers ' and the Backspace key for editing If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtTest2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtTest2.KeyPress ' allows the text box to accept only numbers ' and the Backspace key for editing If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub End Class

Chap11/Average Solution/Average Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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_Project.frmMain End Sub End Class End Namespace

Chap11/Average Solution/Average 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>

Chap11/Average Solution/Average 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 Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Average Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("958d106d-fc69-454b-aab5-c941f111e3f1")> ' 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")>

Chap11/Average Solution/Average Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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_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

Chap11/Average Solution/Average 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

Chap11/Average Solution/Average Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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_Project.My.MySettings Get Return Global.Average_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/Average Solution/Average Project/My Project/Settings.settings

Chap11/Average Solution/Average Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Average Project", "Average Project\Average Project.vbproj", "{E003054F-192E-4550-8C52-1E06B0663723}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E003054F-192E-4550-8C52-1E06B0663723}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E003054F-192E-4550-8C52-1E06B0663723}.Debug|Any CPU.Build.0 = Debug|Any CPU {E003054F-192E-4550-8C52-1E06B0663723}.Release|Any CPU.ActiveCfg = Release|Any CPU {E003054F-192E-4550-8C52-1E06B0663723}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/Carlton Solution/Carlton Project/App.config

Chap11/Carlton Solution/Carlton Project/Carlton Project.vbproj

Debug AnyCPU {E0FC1162-3614-4CAC-885E-151336CB64F8} WinExe Carlton_Project.My.MyApplication Carlton_Project Carlton Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Carlton Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Carlton 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

Chap11/Carlton Solution/Carlton 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 = "Carlton" 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

Chap11/Carlton Solution/Carlton 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

Chap11/Carlton Solution/Carlton Project/frmMain.vb

' Name: Carlton 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.75 End If ' calculate and display the total amount owed decTotalOwed = intNumCds * decCdPrice lblTotal.Text = decTotalOwed.ToString("C2") End Sub Private Sub txtCdPrice_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtCdPrice.KeyPress ' accept only numbers, the period, and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtNumCds_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtNumCds.KeyPress ' accept only numbers and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub End Class

Chap11/Carlton Solution/Carlton Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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.Carlton_Project.frmMain End Sub End Class End Namespace

Chap11/Carlton Solution/Carlton 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>

Chap11/Carlton Solution/Carlton 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("Carlton Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Carlton Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("218b85c2-f886-4354-8a81-3da78f2331e2")> ' 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")>

Chap11/Carlton Solution/Carlton Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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("Carlton_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

Chap11/Carlton Solution/Carlton 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

Chap11/Carlton Solution/Carlton Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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.Carlton_Project.My.MySettings Get Return Global.Carlton_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/Carlton Solution/Carlton Project/My Project/Settings.settings

Chap11/Carlton Solution/Carlton Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Carlton Project", "Carlton Project\Carlton Project.vbproj", "{E0FC1162-3614-4CAC-885E-151336CB64F8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E0FC1162-3614-4CAC-885E-151336CB64F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E0FC1162-3614-4CAC-885E-151336CB64F8}.Debug|Any CPU.Build.0 = Debug|Any CPU {E0FC1162-3614-4CAC-885E-151336CB64F8}.Release|Any CPU.ActiveCfg = Release|Any CPU {E0FC1162-3614-4CAC-885E-151336CB64F8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/CD Shop Solution/CD Shop Project/App.config

Chap11/CD Shop Solution/CD Shop Project/CD Shop Project.vbproj

Debug AnyCPU {641C1BAA-3ED2-47DA-AFE2-08E064AC0FF5} WinExe CD_Shop_Project.My.MyApplication CD_Shop_Project CD Shop Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ CD Shop Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ CD Shop 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

Chap11/CD Shop Solution/CD Shop 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.Label1 = New System.Windows.Forms.Label() Me.txtCds = New System.Windows.Forms.TextBox() Me.Label2 = 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() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'PictureBox1 ' Me.PictureBox1.Image = Global.CD_Shop_Project.My.Resources.Resources.CD Me.PictureBox1.Location = New System.Drawing.Point(13, 13) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(121, 100) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 0 Me.PictureBox1.TabStop = False ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(149, 13) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(114, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Number of CDs:" ' 'txtCds ' Me.txtCds.Location = New System.Drawing.Point(153, 36) Me.txtCds.Name = "txtCds" Me.txtCds.Size = New System.Drawing.Size(41, 27) Me.txtCds.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(284, 13) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(75, 20) Me.Label2.TabIndex = 4 Me.Label2.Text = "Total due:" ' 'lblTotalDue ' Me.lblTotalDue.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblTotalDue.Location = New System.Drawing.Point(288, 33) Me.lblTotalDue.Name = "lblTotalDue" Me.lblTotalDue.Size = New System.Drawing.Size(87, 27) Me.lblTotalDue.TabIndex = 5 Me.lblTotalDue.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(153, 84) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(80, 29) Me.btnCalc.TabIndex = 2 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(295, 84) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(80, 29) 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(396, 139) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblTotalDue) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtCds) Me.Controls.Add(Me.Label1) 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 = "CD Shop" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtCds As System.Windows.Forms.TextBox Friend WithEvents Label2 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

Chap11/CD Shop Solution/CD Shop 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

Chap11/CD Shop Solution/CD Shop Project/frmMain.vb

' Name: CD Shop Project ' Purpose: Display the total 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 due Const intPRICE As Integer = 10 Const decDISC5 As Decimal = 0.05 Const decDISC7 As Decimal = 0.07 Dim intCds As Integer Dim decSubtotal As Decimal Dim decDiscount As Decimal Dim decTotalDue As Decimal Integer.TryParse(txtCds.Text, intCds) ' calculate subtotal decSubtotal = intCds * intPRICE ' calculate discount, if necessary If intCds > 10 Then decDiscount = decSubtotal * decDISC7 Else If intCds > 5 Then decDiscount = decSubtotal * decDISC5 End If End If ' calculate and display total due decTotalDue = decSubtotal - decDiscount lblTotalDue.Text = decTotalDue.ToString("C2") End Sub Private Sub txtCds_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtCds.KeyPress ' allows the text box to accept only numbers ' and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub End Class

Chap11/CD Shop Solution/CD Shop 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.CD_Shop_Project.frmMain End Sub End Class End Namespace

Chap11/CD Shop Solution/CD Shop 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>

Chap11/CD Shop Solution/CD Shop 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("CD Shop Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("CD Shop 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("a67319b7-cbb4-45dd-8b4a-65774d219c76")> ' 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")>

Chap11/CD Shop Solution/CD Shop 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("CD_Shop_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 CD() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("CD", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace

Chap11/CD Shop Solution/CD Shop 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\CD.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Chap11/CD Shop Solution/CD Shop 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.CD_Shop_Project.My.MySettings Get Return Global.CD_Shop_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/CD Shop Solution/CD Shop Project/My Project/Settings.settings

Chap11/CD Shop Solution/CD Shop Project/Resources/CD.png

Chap11/CD Shop Solution/CD Shop Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "CD Shop Project", "CD Shop Project\CD Shop Project.vbproj", "{641C1BAA-3ED2-47DA-AFE2-08E064AC0FF5}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {641C1BAA-3ED2-47DA-AFE2-08E064AC0FF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {641C1BAA-3ED2-47DA-AFE2-08E064AC0FF5}.Debug|Any CPU.Build.0 = Debug|Any CPU {641C1BAA-3ED2-47DA-AFE2-08E064AC0FF5}.Release|Any CPU.ActiveCfg = Release|Any CPU {641C1BAA-3ED2-47DA-AFE2-08E064AC0FF5}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/Coffee Palace Solution-Version 1/Coffee Palace Project/App.config

Chap11/Coffee Palace Solution-Version 1/Coffee Palace Project/Coffee Palace Project.vbproj

Debug AnyCPU {D483C268-6652-4241-BEAC-540B89C51D12} WinExe Coffee_Palace_Project.My.MyApplication Coffee_Palace_Project Coffee Palace Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Coffee Palace Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Coffee Palace 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

Chap11/Coffee Palace Solution-Version 1/Coffee Palace 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.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.txtPounds = New System.Windows.Forms.TextBox() Me.lblTotalPrice = New System.Windows.Forms.Label() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Coffee_Palace_Project.My.Resources.Resources.Coffee Me.PictureBox1.Location = New System.Drawing.Point(13, 13) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(97, 91) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 0 Me.PictureBox1.TabStop = False ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(127, 13) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(117, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Pounds ordered:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(127, 81) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(83, 20) Me.Label2.TabIndex = 4 Me.Label2.Text = "Total price:" ' 'txtPounds ' Me.txtPounds.Location = New System.Drawing.Point(131, 36) Me.txtPounds.Name = "txtPounds" Me.txtPounds.Size = New System.Drawing.Size(38, 27) Me.txtPounds.TabIndex = 1 ' 'lblTotalPrice ' Me.lblTotalPrice.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblTotalPrice.Location = New System.Drawing.Point(131, 106) Me.lblTotalPrice.Name = "lblTotalPrice" Me.lblTotalPrice.Size = New System.Drawing.Size(100, 27) Me.lblTotalPrice.TabIndex = 5 Me.lblTotalPrice.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(256, 69) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(85, 29) Me.btnCalc.TabIndex = 2 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(256, 104) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(85, 29) 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(358, 160) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblTotalPrice) Me.Controls.Add(Me.txtPounds) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) 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 = "Coffee Palace-Version 1" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtPounds As System.Windows.Forms.TextBox Friend WithEvents lblTotalPrice As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap11/Coffee Palace Solution-Version 1/Coffee Palace 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

Chap11/Coffee Palace Solution-Version 1/Coffee Palace Project/frmMain.vb

' Name: Coffee Palace Project ' Purpose: Display the total price ' 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 price Const intPRICE As Integer = 13 Dim decPounds As Decimal Dim decTotalPrice As Decimal Decimal.TryParse(txtPounds.Text, decPounds) ' calculate and display total price decTotalPrice = decPounds * intPRICE lblTotalPrice.Text = decTotalPrice.ToString("C2") End Sub End Class

Chap11/Coffee Palace Solution-Version 1/Coffee Palace 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.Coffee_Palace_Project.frmMain End Sub End Class End Namespace

Chap11/Coffee Palace Solution-Version 1/Coffee Palace 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>

Chap11/Coffee Palace Solution-Version 1/Coffee Palace 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("Coffee Palace Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("Coffee Palace 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("cfbbe907-840d-491f-af90-10f3e8cd6f07")> ' 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")>

Chap11/Coffee Palace Solution-Version 1/Coffee Palace 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("Coffee_Palace_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 Coffee() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Coffee", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace

Chap11/Coffee Palace Solution-Version 1/Coffee Palace 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\Coffee.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Chap11/Coffee Palace Solution-Version 1/Coffee Palace 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.Coffee_Palace_Project.My.MySettings Get Return Global.Coffee_Palace_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/Coffee Palace Solution-Version 1/Coffee Palace Project/My Project/Settings.settings

Chap11/Coffee Palace Solution-Version 1/Coffee Palace Project/Resources/Coffee.png

Chap11/Coffee Palace Solution-Version 1/Coffee Palace Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Coffee Palace Project", "Coffee Palace Project\Coffee Palace Project.vbproj", "{D483C268-6652-4241-BEAC-540B89C51D12}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D483C268-6652-4241-BEAC-540B89C51D12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D483C268-6652-4241-BEAC-540B89C51D12}.Debug|Any CPU.Build.0 = Debug|Any CPU {D483C268-6652-4241-BEAC-540B89C51D12}.Release|Any CPU.ActiveCfg = Release|Any CPU {D483C268-6652-4241-BEAC-540B89C51D12}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/Coffee Palace Solution-Version 2/Coffee Palace Project/App.config

Chap11/Coffee Palace Solution-Version 2/Coffee Palace Project/Coffee Palace Project.vbproj

Debug AnyCPU {D483C268-6652-4241-BEAC-540B89C51D12} WinExe Coffee_Palace_Project.My.MyApplication Coffee_Palace_Project Coffee Palace Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Coffee Palace Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Coffee Palace 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

Chap11/Coffee Palace Solution-Version 2/Coffee Palace 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.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.txtPounds = New System.Windows.Forms.TextBox() Me.lblTotalPrice = New System.Windows.Forms.Label() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Coffee_Palace_Project.My.Resources.Resources.Coffee Me.PictureBox1.Location = New System.Drawing.Point(13, 13) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(97, 91) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 0 Me.PictureBox1.TabStop = False ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(127, 13) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(117, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Pounds ordered:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(127, 81) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(83, 20) Me.Label2.TabIndex = 4 Me.Label2.Text = "Total price:" ' 'txtPounds ' Me.txtPounds.Location = New System.Drawing.Point(131, 36) Me.txtPounds.Name = "txtPounds" Me.txtPounds.Size = New System.Drawing.Size(38, 27) Me.txtPounds.TabIndex = 1 ' 'lblTotalPrice ' Me.lblTotalPrice.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblTotalPrice.Location = New System.Drawing.Point(131, 106) Me.lblTotalPrice.Name = "lblTotalPrice" Me.lblTotalPrice.Size = New System.Drawing.Size(100, 27) Me.lblTotalPrice.TabIndex = 5 Me.lblTotalPrice.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(256, 69) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(85, 29) Me.btnCalc.TabIndex = 2 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(256, 104) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(85, 29) 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(358, 160) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblTotalPrice) Me.Controls.Add(Me.txtPounds) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) 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 = "Coffee Palace-Version 2" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtPounds As System.Windows.Forms.TextBox Friend WithEvents lblTotalPrice As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap11/Coffee Palace Solution-Version 2/Coffee Palace 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

Chap11/Coffee Palace Solution-Version 2/Coffee Palace Project/frmMain.vb

' Name: Coffee Palace Project ' Purpose: Display the total price ' 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 price Const intPRICE As Integer = 13 Dim intPounds As Integer Dim intTotalPrice As Integer Integer.TryParse(txtPounds.Text, intPounds) ' calculate and display total price intTotalPrice = intPounds * intPRICE lblTotalPrice.Text = intTotalPrice.ToString("C2") End Sub End Class

Chap11/Coffee Palace Solution-Version 2/Coffee Palace 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.Coffee_Palace_Project.frmMain End Sub End Class End Namespace

Chap11/Coffee Palace Solution-Version 2/Coffee Palace 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>

Chap11/Coffee Palace Solution-Version 2/Coffee Palace 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("Coffee Palace Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("Coffee Palace 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("cfbbe907-840d-491f-af90-10f3e8cd6f07")> ' 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")>

Chap11/Coffee Palace Solution-Version 2/Coffee Palace 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("Coffee_Palace_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 Coffee() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Coffee", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace

Chap11/Coffee Palace Solution-Version 2/Coffee Palace 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\Coffee.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Chap11/Coffee Palace Solution-Version 2/Coffee Palace 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.Coffee_Palace_Project.My.MySettings Get Return Global.Coffee_Palace_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/Coffee Palace Solution-Version 2/Coffee Palace Project/My Project/Settings.settings

Chap11/Coffee Palace Solution-Version 2/Coffee Palace Project/Resources/Coffee.png

Chap11/Coffee Palace Solution-Version 2/Coffee Palace Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Coffee Palace Project", "Coffee Palace Project\Coffee Palace Project.vbproj", "{D483C268-6652-4241-BEAC-540B89C51D12}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D483C268-6652-4241-BEAC-540B89C51D12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D483C268-6652-4241-BEAC-540B89C51D12}.Debug|Any CPU.Build.0 = Debug|Any CPU {D483C268-6652-4241-BEAC-540B89C51D12}.Release|Any CPU.ActiveCfg = Release|Any CPU {D483C268-6652-4241-BEAC-540B89C51D12}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/FigureThisOut Solution/FigureThisOut Project/App.config

Chap11/FigureThisOut Solution/FigureThisOut Project/FigureThisOut Project.vbproj

Debug AnyCPU {0DD34252-CB9A-4D6A-8F91-210971692F47} 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

Chap11/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.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.txtSales1 = New System.Windows.Forms.TextBox() Me.txtSales2 = New System.Windows.Forms.TextBox() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.Label3 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.lblComm1 = New System.Windows.Forms.Label() Me.lblComm2 = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(40, 41) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(107, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "Region &1 sales:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(219, 41) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(107, 20) Me.Label2.TabIndex = 2 Me.Label2.Text = "Region &2 sales:" ' 'txtSales1 ' Me.txtSales1.Location = New System.Drawing.Point(45, 65) Me.txtSales1.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtSales1.Name = "txtSales1" Me.txtSales1.Size = New System.Drawing.Size(78, 27) Me.txtSales1.TabIndex = 1 ' 'txtSales2 ' Me.txtSales2.Location = New System.Drawing.Point(223, 65) Me.txtSales2.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtSales2.Name = "txtSales2" Me.txtSales2.Size = New System.Drawing.Size(78, 27) Me.txtSales2.TabIndex = 3 ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(147, 220) Me.btnCalc.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(102, 34) Me.btnCalc.TabIndex = 4 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(255, 220) Me.btnExit.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(71, 34) Me.btnExit.TabIndex = 5 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(40, 133) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(154, 20) Me.Label3.TabIndex = 6 Me.Label3.Text = "Region 1 commission:" ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(219, 133) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(154, 20) Me.Label4.TabIndex = 8 Me.Label4.Text = "Region 2 commission:" ' 'lblComm1 ' Me.lblComm1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblComm1.Location = New System.Drawing.Point(45, 158) Me.lblComm1.Name = "lblComm1" Me.lblComm1.Size = New System.Drawing.Size(91, 33) Me.lblComm1.TabIndex = 7 Me.lblComm1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'lblComm2 ' Me.lblComm2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblComm2.Location = New System.Drawing.Point(223, 158) Me.lblComm2.Name = "lblComm2" Me.lblComm2.Size = New System.Drawing.Size(91, 33) Me.lblComm2.TabIndex = 9 Me.lblComm2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' '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, 284) Me.Controls.Add(Me.lblComm2) Me.Controls.Add(Me.lblComm1) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.txtSales2) Me.Controls.Add(Me.txtSales1) 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(3, 6, 3, 6) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "FigureThisOut" 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 txtSales1 As System.Windows.Forms.TextBox Friend WithEvents txtSales2 As System.Windows.Forms.TextBox Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents lblComm1 As System.Windows.Forms.Label Friend WithEvents lblComm2 As System.Windows.Forms.Label End Class

Chap11/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 True True True True

Chap11/FigureThisOut Solution/FigureThisOut Project/frmMain.vb

' Name: FigureThisOut Project ' Purpose: Display a 10% 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 btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' displays a 10% commission Const decRATE As Decimal = 0.1 Dim intSales1 As Integer Dim decSales2 As Decimal Dim decComm1 As Decimal Dim decComm2 As Decimal ' assign sales amounts to variables Integer.TryParse(txtSales1.Text, intSales1) Decimal.TryParse(txtSales2.Text, decSales2) ' calculate the commission decComm1 = intSales1 * decRATE decComm2 = decSales2 * decRATE ' display the commission lblComm1.Text = decComm1.ToString("C2") lblComm2.Text = decComm2.ToString("C2") End Sub End Class

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

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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

Chap11/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>

Chap11/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("")> <Assembly: AssemblyProduct("FigureThisOut Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("e5d2c21d-bdc2-4829-b3a8-08e305562f1e")> ' 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")>

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

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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

Chap11/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

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

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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

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

Chap11/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", "{0DD34252-CB9A-4D6A-8F91-210971692F47}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {0DD34252-CB9A-4D6A-8F91-210971692F47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0DD34252-CB9A-4D6A-8F91-210971692F47}.Debug|Any CPU.Build.0 = Debug|Any CPU {0DD34252-CB9A-4D6A-8F91-210971692F47}.Release|Any CPU.ActiveCfg = Release|Any CPU {0DD34252-CB9A-4D6A-8F91-210971692F47}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/Gross Pay Solution/Gross Pay Project/App.config

Chap11/Gross Pay Solution/Gross 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.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.txtHours = New System.Windows.Forms.TextBox() Me.txtRate = New System.Windows.Forms.TextBox() Me.lblGross = New System.Windows.Forms.Label() Me.btnExit = New System.Windows.Forms.Button() Me.btnCalc = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(59, 38) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(104, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Hours worked:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(205, 38) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(86, 20) Me.Label2.TabIndex = 2 Me.Label2.Text = "Hourly &rate:" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(24, 134) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(76, 20) Me.Label3.TabIndex = 6 Me.Label3.Text = "Gross pay:" ' 'txtHours ' Me.txtHours.Location = New System.Drawing.Point(63, 61) Me.txtHours.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtHours.Name = "txtHours" Me.txtHours.Size = New System.Drawing.Size(68, 27) Me.txtHours.TabIndex = 1 ' 'txtRate ' Me.txtRate.Location = New System.Drawing.Point(208, 61) Me.txtRate.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtRate.Name = "txtRate" Me.txtRate.Size = New System.Drawing.Size(68, 27) Me.txtRate.TabIndex = 3 ' 'lblGross ' Me.lblGross.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblGross.Location = New System.Drawing.Point(25, 158) Me.lblGross.Name = "lblGross" Me.lblGross.Size = New System.Drawing.Size(106, 35) Me.lblGross.TabIndex = 7 Me.lblGross.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(261, 154) Me.btnExit.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(74, 39) Me.btnExit.TabIndex = 5 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(147, 154) Me.btnCalc.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(106, 39) Me.btnCalc.TabIndex = 4 Me.btnCalc.Text = "&Calculate " Me.btnCalc.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(361, 233) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.lblGross) Me.Controls.Add(Me.txtRate) Me.Controls.Add(Me.txtHours) 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(3, 6, 3, 6) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Gross Pay 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 txtHours As System.Windows.Forms.TextBox Friend WithEvents txtRate As System.Windows.Forms.TextBox Friend WithEvents lblGross As System.Windows.Forms.Label Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnCalc As System.Windows.Forms.Button End Class

Chap11/Gross Pay Solution/Gross 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

Chap11/Gross Pay Solution/Gross Pay Project/frmMain.vb

' Name: Gross Pay Project ' Purpose: Display an employee's gross pay ' 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 gross pay Dim decHours As Decimal Dim decRate As Decimal Dim decGross As Decimal ' assign hours and rate to variables Decimal.TryParse(txtHours.Text, decHours) Decimal.TryParse(txtRate.Text, decRate) ' calculate and display gross pay If decHours <= 40.0 Then decGross = decHours * decRate Else decGross = decHours * decRate + (decHours - 40) * decRate / 2 End If lblGross.Text = decGross.ToString("C2") End Sub End Class

Chap11/Gross Pay Solution/Gross Pay Project/Gross Pay Project.vbproj

Debug AnyCPU {8144DB2B-8913-48E4-8A16-BE82ABBBBA4E} WinExe Gross_Pay_Project.My.MyApplication Gross_Pay_Project Gross Pay Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Gross Pay Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Gross 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

Chap11/Gross Pay Solution/Gross Pay Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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.Gross_Pay_Project.frmMain End Sub End Class End Namespace

Chap11/Gross Pay Solution/Gross 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>

Chap11/Gross Pay Solution/Gross 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("Gross Pay Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Gross Pay Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("0f098e63-deac-4b25-8cdf-c7726c08056f")> ' 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")>

Chap11/Gross Pay Solution/Gross Pay Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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("Gross_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

Chap11/Gross Pay Solution/Gross 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

Chap11/Gross Pay Solution/Gross Pay Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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.Gross_Pay_Project.My.MySettings Get Return Global.Gross_Pay_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/Gross Pay Solution/Gross Pay Project/My Project/Settings.settings

Chap11/Gross Pay Solution/Gross Pay Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Gross Pay Project", "Gross Pay Project\Gross Pay Project.vbproj", "{8144DB2B-8913-48E4-8A16-BE82ABBBBA4E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {8144DB2B-8913-48E4-8A16-BE82ABBBBA4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8144DB2B-8913-48E4-8A16-BE82ABBBBA4E}.Debug|Any CPU.Build.0 = Debug|Any CPU {8144DB2B-8913-48E4-8A16-BE82ABBBBA4E}.Release|Any CPU.ActiveCfg = Release|Any CPU {8144DB2B-8913-48E4-8A16-BE82ABBBBA4E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/Sales Tax Solution/Sales Tax Project/App.config

Chap11/Sales Tax Solution/Sales Tax 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.lblTax = New System.Windows.Forms.Label() Me.txtSale = 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(25, 33) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(95, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Sale amount:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(25, 81) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(70, 20) Me.Label2.TabIndex = 4 Me.Label2.Text = "Sales tax:" ' 'lblTax ' Me.lblTax.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblTax.Location = New System.Drawing.Point(103, 76) Me.lblTax.Name = "lblTax" Me.lblTax.Size = New System.Drawing.Size(105, 28) Me.lblTax.TabIndex = 5 Me.lblTax.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'txtSale ' Me.txtSale.Location = New System.Drawing.Point(127, 29) Me.txtSale.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtSale.Name = "txtSale" Me.txtSale.Size = New System.Drawing.Size(82, 27) Me.txtSale.TabIndex = 1 ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(229, 29) Me.btnCalc.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(149, 34) Me.btnCalc.TabIndex = 2 Me.btnCalc.Text = "&Calculate Sales Tax" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(229, 76) Me.btnExit.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(149, 34) 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(405, 147) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.txtSale) Me.Controls.Add(Me.lblTax) 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(3, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Sales Tax 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 lblTax As System.Windows.Forms.Label Friend WithEvents txtSale As System.Windows.Forms.TextBox Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap11/Sales Tax Solution/Sales Tax 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

Chap11/Sales Tax Solution/Sales Tax Project/frmMain.vb

' Name: Sales Tax Project ' Purpose: Display the sales tax ' 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% sales tax Const decTAX_RATE1 As Decimal = 0.1 Const decTAX_RATE2 As Decimal = 0.12 Dim decSale As Decimal Dim decTax As Decimal ' assign user input to a variable Decimal.TryParse(txtSale.Text, decSale) ' calculate and display the sales tax If decSale >= 0 AndAlso decSale <= 10000 Then decTax = decSale * decTAX_RATE1 ElseIf decSale > 10000 Then decTax = decSale * decTAX_RATE2 End If lblTax.Text = decTax.ToString("C2") End Sub End Class

Chap11/Sales Tax Solution/Sales Tax Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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.Sales_Tax_Project.frmMain End Sub End Class End Namespace

Chap11/Sales Tax Solution/Sales Tax 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>

Chap11/Sales Tax Solution/Sales Tax 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("Sales Tax Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Sales Tax Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("7e38fc97-54a4-460f-83f5-8b044e798f65")> ' 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")>

Chap11/Sales Tax Solution/Sales Tax Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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("Sales_Tax_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

Chap11/Sales Tax Solution/Sales Tax 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

Chap11/Sales Tax Solution/Sales Tax Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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.Sales_Tax_Project.My.MySettings Get Return Global.Sales_Tax_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/Sales Tax Solution/Sales Tax Project/My Project/Settings.settings

Chap11/Sales Tax Solution/Sales Tax Project/Sales Tax Project.vbproj

Debug AnyCPU {5A0246D8-F7E5-44E9-8D18-F8BC7F88D938} WinExe Sales_Tax_Project.My.MyApplication Sales_Tax_Project Sales Tax Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Sales Tax Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Sales Tax 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

Chap11/Sales Tax Solution/Sales Tax Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Sales Tax Project", "Sales Tax Project\Sales Tax Project.vbproj", "{5A0246D8-F7E5-44E9-8D18-F8BC7F88D938}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {5A0246D8-F7E5-44E9-8D18-F8BC7F88D938}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5A0246D8-F7E5-44E9-8D18-F8BC7F88D938}.Debug|Any CPU.Build.0 = Debug|Any CPU {5A0246D8-F7E5-44E9-8D18-F8BC7F88D938}.Release|Any CPU.ActiveCfg = Release|Any CPU {5A0246D8-F7E5-44E9-8D18-F8BC7F88D938}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/Shady Hollow Solution/Shady Hollow Project/App.config

Chap11/Shady Hollow Solution/Shady Hollow 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.GroupBox1 = New System.Windows.Forms.GroupBox() Me.radSuite = New System.Windows.Forms.RadioButton() Me.radDeluxe = New System.Windows.Forms.RadioButton() Me.radStandard = New System.Windows.Forms.RadioButton() Me.Label1 = New System.Windows.Forms.Label() Me.lblRate = New System.Windows.Forms.Label() Me.btnGet = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.radSuite) Me.GroupBox1.Controls.Add(Me.radDeluxe) Me.GroupBox1.Controls.Add(Me.radStandard) Me.GroupBox1.Location = New System.Drawing.Point(15, 17) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(119, 121) Me.GroupBox1.TabIndex = 2 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Room type" ' 'radSuite ' Me.radSuite.AutoSize = True Me.radSuite.Location = New System.Drawing.Point(13, 89) Me.radSuite.Name = "radSuite" Me.radSuite.Size = New System.Drawing.Size(60, 24) Me.radSuite.TabIndex = 2 Me.radSuite.Text = "Sui&te" Me.radSuite.UseVisualStyleBackColor = True ' 'radDeluxe ' Me.radDeluxe.AutoSize = True Me.radDeluxe.Location = New System.Drawing.Point(13, 58) Me.radDeluxe.Name = "radDeluxe" Me.radDeluxe.Size = New System.Drawing.Size(73, 24) Me.radDeluxe.TabIndex = 1 Me.radDeluxe.Text = "&Deluxe" Me.radDeluxe.UseVisualStyleBackColor = True ' 'radStandard ' Me.radStandard.AutoSize = True Me.radStandard.Checked = True Me.radStandard.Location = New System.Drawing.Point(13, 27) Me.radStandard.Name = "radStandard" Me.radStandard.Size = New System.Drawing.Size(87, 24) Me.radStandard.TabIndex = 0 Me.radStandard.TabStop = True Me.radStandard.Text = "&Standard" Me.radStandard.UseVisualStyleBackColor = True ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(159, 33) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(76, 20) Me.Label1.TabIndex = 3 Me.Label1.Text = "Daily rate:" ' 'lblRate ' Me.lblRate.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblRate.Font = New System.Drawing.Font("Segoe UI Semibold", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblRate.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer)) Me.lblRate.Location = New System.Drawing.Point(241, 33) Me.lblRate.Name = "lblRate" Me.lblRate.Size = New System.Drawing.Size(84, 25) Me.lblRate.TabIndex = 4 Me.lblRate.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnGet ' Me.btnGet.Location = New System.Drawing.Point(163, 70) Me.btnGet.Name = "btnGet" Me.btnGet.Size = New System.Drawing.Size(78, 29) Me.btnGet.TabIndex = 0 Me.btnGet.Text = "&Get Rate" Me.btnGet.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(247, 70) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(78, 29) Me.btnExit.TabIndex = 1 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(340, 158) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnGet) Me.Controls.Add(Me.lblRate) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.GroupBox1) 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 = "Shady Hollow Hotel" Me.GroupBox1.ResumeLayout(False) Me.GroupBox1.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents radSuite As System.Windows.Forms.RadioButton Friend WithEvents radDeluxe As System.Windows.Forms.RadioButton Friend WithEvents radStandard As System.Windows.Forms.RadioButton Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents lblRate As System.Windows.Forms.Label Friend WithEvents btnGet As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap11/Shady Hollow Solution/Shady Hollow 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

Chap11/Shady Hollow Solution/Shady Hollow Project/frmMain.vb

' Name: Shady Hollow Project ' Purpose: Display the daily rate ' 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 btnGet_Click(sender As Object, e As EventArgs) Handles btnGet.Click ' displays a room's daily rate Dim intRate As Integer Select Case True Case radStandard.Checked intRate = 90 Case radDeluxe.Checked intRate = 115 Case Else intRate = 130 End Select ' display daily rate lblRate.Text = intRate.ToString("C0") End Sub End Class

Chap11/Shady Hollow Solution/Shady Hollow 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.Shady_Hollow_Project.frmMain End Sub End Class End Namespace

Chap11/Shady Hollow Solution/Shady Hollow 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>

Chap11/Shady Hollow Solution/Shady Hollow 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("Shady Hollow Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("Shady Hollow 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("22043875-177d-4370-b566-46ab829f769c")> ' 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")>

Chap11/Shady Hollow Solution/Shady Hollow 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("Shady_Hollow_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

Chap11/Shady Hollow Solution/Shady Hollow 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

Chap11/Shady Hollow Solution/Shady Hollow 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.Shady_Hollow_Project.My.MySettings Get Return Global.Shady_Hollow_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/Shady Hollow Solution/Shady Hollow Project/My Project/Settings.settings

Chap11/Shady Hollow Solution/Shady Hollow Project/Shady Hollow Project.vbproj

Debug AnyCPU {326F09E9-C817-4C10-B72E-48B708829B1A} WinExe Shady_Hollow_Project.My.MyApplication Shady_Hollow_Project Shady Hollow Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Shady Hollow Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Shady Hollow 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

Chap11/Shady Hollow Solution/Shady Hollow Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Shady Hollow Project", "Shady Hollow Project\Shady Hollow Project.vbproj", "{326F09E9-C817-4C10-B72E-48B708829B1A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {326F09E9-C817-4C10-B72E-48B708829B1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {326F09E9-C817-4C10-B72E-48B708829B1A}.Debug|Any CPU.Build.0 = Debug|Any CPU {326F09E9-C817-4C10-B72E-48B708829B1A}.Release|Any CPU.ActiveCfg = Release|Any CPU {326F09E9-C817-4C10-B72E-48B708829B1A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/Shady Hollow Solution-Version 2/Shady Hollow Project/App.config

Chap11/Shady Hollow Solution-Version 2/Shady Hollow 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.GroupBox1 = New System.Windows.Forms.GroupBox() Me.radSuite = New System.Windows.Forms.RadioButton() Me.radDeluxe = New System.Windows.Forms.RadioButton() Me.radStandard = New System.Windows.Forms.RadioButton() Me.Label1 = New System.Windows.Forms.Label() Me.lblRate = New System.Windows.Forms.Label() Me.btnGet = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.chkGoldClub = New System.Windows.Forms.CheckBox() Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.radSuite) Me.GroupBox1.Controls.Add(Me.radDeluxe) Me.GroupBox1.Controls.Add(Me.radStandard) Me.GroupBox1.Location = New System.Drawing.Point(15, 17) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(119, 121) Me.GroupBox1.TabIndex = 2 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Room type" ' 'radSuite ' Me.radSuite.AutoSize = True Me.radSuite.Location = New System.Drawing.Point(13, 89) Me.radSuite.Name = "radSuite" Me.radSuite.Size = New System.Drawing.Size(60, 24) Me.radSuite.TabIndex = 2 Me.radSuite.Text = "Sui&te" Me.radSuite.UseVisualStyleBackColor = True ' 'radDeluxe ' Me.radDeluxe.AutoSize = True Me.radDeluxe.Location = New System.Drawing.Point(13, 58) Me.radDeluxe.Name = "radDeluxe" Me.radDeluxe.Size = New System.Drawing.Size(73, 24) Me.radDeluxe.TabIndex = 1 Me.radDeluxe.Text = "&Deluxe" Me.radDeluxe.UseVisualStyleBackColor = True ' 'radStandard ' Me.radStandard.AutoSize = True Me.radStandard.Checked = True Me.radStandard.Location = New System.Drawing.Point(13, 27) Me.radStandard.Name = "radStandard" Me.radStandard.Size = New System.Drawing.Size(87, 24) Me.radStandard.TabIndex = 0 Me.radStandard.TabStop = True Me.radStandard.Text = "&Standard" Me.radStandard.UseVisualStyleBackColor = True ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(159, 69) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(76, 20) Me.Label1.TabIndex = 4 Me.Label1.Text = "Daily rate:" ' 'lblRate ' Me.lblRate.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblRate.Font = New System.Drawing.Font("Segoe UI Semibold", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblRate.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(0, Byte), Integer)) Me.lblRate.Location = New System.Drawing.Point(241, 69) Me.lblRate.Name = "lblRate" Me.lblRate.Size = New System.Drawing.Size(84, 25) Me.lblRate.TabIndex = 5 Me.lblRate.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnGet ' Me.btnGet.Location = New System.Drawing.Point(163, 106) Me.btnGet.Name = "btnGet" Me.btnGet.Size = New System.Drawing.Size(78, 29) Me.btnGet.TabIndex = 0 Me.btnGet.Text = "&Get Rate" Me.btnGet.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(247, 106) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(78, 29) Me.btnExit.TabIndex = 1 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'chkGoldClub ' Me.chkGoldClub.AutoSize = True Me.chkGoldClub.Location = New System.Drawing.Point(163, 17) Me.chkGoldClub.Name = "chkGoldClub" Me.chkGoldClub.Size = New System.Drawing.Size(92, 24) Me.chkGoldClub.TabIndex = 3 Me.chkGoldClub.Text = "&Gold club" Me.chkGoldClub.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(340, 158) Me.Controls.Add(Me.chkGoldClub) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnGet) Me.Controls.Add(Me.lblRate) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.GroupBox1) 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 = "Shady Hollow Hotel" Me.GroupBox1.ResumeLayout(False) Me.GroupBox1.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents radSuite As System.Windows.Forms.RadioButton Friend WithEvents radDeluxe As System.Windows.Forms.RadioButton Friend WithEvents radStandard As System.Windows.Forms.RadioButton Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents lblRate As System.Windows.Forms.Label Friend WithEvents btnGet As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents chkGoldClub As System.Windows.Forms.CheckBox End Class

Chap11/Shady Hollow Solution-Version 2/Shady Hollow 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

Chap11/Shady Hollow Solution-Version 2/Shady Hollow Project/frmMain.vb

' Name: Shady Hollow Project ' Purpose: Display the daily rate ' 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 btnGet_Click(sender As Object, e As EventArgs) Handles btnGet.Click ' displays a room's daily rate Const intGOLD_CLUB As Integer = 10 Dim intRate As Integer Select Case True Case radStandard.Checked intRate = 90 Case radDeluxe.Checked intRate = 115 Case Else intRate = 130 End Select ' subtract Gold Club discount If chkGoldClub.Checked = True Then intRate = intRate - intGOLD_CLUB End If ' display daily rate lblRate.Text = intRate.ToString("C0") End Sub End Class

Chap11/Shady Hollow Solution-Version 2/Shady Hollow 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.Shady_Hollow_Project.frmMain End Sub End Class End Namespace

Chap11/Shady Hollow Solution-Version 2/Shady Hollow 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>

Chap11/Shady Hollow Solution-Version 2/Shady Hollow 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("Shady Hollow Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("Shady Hollow 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("22043875-177d-4370-b566-46ab829f769c")> ' 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")>

Chap11/Shady Hollow Solution-Version 2/Shady Hollow 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("Shady_Hollow_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

Chap11/Shady Hollow Solution-Version 2/Shady Hollow 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

Chap11/Shady Hollow Solution-Version 2/Shady Hollow 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.Shady_Hollow_Project.My.MySettings Get Return Global.Shady_Hollow_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/Shady Hollow Solution-Version 2/Shady Hollow Project/My Project/Settings.settings

Chap11/Shady Hollow Solution-Version 2/Shady Hollow Project/Shady Hollow Project.vbproj

Debug AnyCPU {326F09E9-C817-4C10-B72E-48B708829B1A} WinExe Shady_Hollow_Project.My.MyApplication Shady_Hollow_Project Shady Hollow Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Shady Hollow Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Shady Hollow 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

Chap11/Shady Hollow Solution-Version 2/Shady Hollow Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Shady Hollow Project", "Shady Hollow Project\Shady Hollow Project.vbproj", "{326F09E9-C817-4C10-B72E-48B708829B1A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {326F09E9-C817-4C10-B72E-48B708829B1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {326F09E9-C817-4C10-B72E-48B708829B1A}.Debug|Any CPU.Build.0 = Debug|Any CPU {326F09E9-C817-4C10-B72E-48B708829B1A}.Release|Any CPU.ActiveCfg = Release|Any CPU {326F09E9-C817-4C10-B72E-48B708829B1A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/Shelby Solution/Shelby Project/App.config

Chap11/Shelby Solution/Shelby 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.txtSales = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.lblBonus = 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, 27) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(46, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Sales:" ' 'txtSales ' Me.txtSales.Location = New System.Drawing.Point(82, 23) Me.txtSales.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtSales.Name = "txtSales" Me.txtSales.Size = New System.Drawing.Size(114, 27) Me.txtSales.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(22, 78) 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(82, 75) Me.lblBonus.Name = "lblBonus" Me.lblBonus.Size = New System.Drawing.Size(114, 33) Me.lblBonus.TabIndex = 5 Me.lblBonus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(228, 27) Me.btnCalc.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(92, 29) Me.btnCalc.TabIndex = 2 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(228, 77) Me.btnExit.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(92, 29) 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(352, 136) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblBonus) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtSales) 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, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Shelby Bonus Calculator" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtSales As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents lblBonus As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap11/Shelby Solution/Shelby 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

Chap11/Shelby Solution/Shelby Project/frmMain.vb

' Name: Shelby Project ' Purpose: Display the 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 Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates and displays a bonus amount Const decRATE1 As Decimal = 0.05 Const decRATE2 As Decimal = 0.1 Dim decSales As Decimal Dim decBonus As Decimal ' assign sales amount to a variable Decimal.TryParse(txtSales.Text, decSales) ' calculate bonus amount Select Case decSales Case 100 To 5000 decBonus = decSales * decRATE1 Case Is > 5000 decBonus = decSales * decRATE2 Case Else decBonus = 0 End Select ' display bonus amount lblBonus.Text = decBonus.ToString("C2") End Sub End Class

Chap11/Shelby Solution/Shelby Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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.Shelby_Project.frmMain End Sub End Class End Namespace

Chap11/Shelby Solution/Shelby 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>

Chap11/Shelby Solution/Shelby 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("Shelby Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Shelby Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("f838e880-3d09-4804-bc86-9b7db8364554")> ' 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")>

Chap11/Shelby Solution/Shelby Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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("Shelby_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

Chap11/Shelby Solution/Shelby 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

Chap11/Shelby Solution/Shelby Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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.Shelby_Project.My.MySettings Get Return Global.Shelby_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/Shelby Solution/Shelby Project/My Project/Settings.settings

Chap11/Shelby Solution/Shelby Project/Shelby Project.vbproj

Debug AnyCPU {D04EFA0C-1C5D-4C6F-A1CC-416F48CBFD9F} WinExe Shelby_Project.My.MyApplication Shelby_Project Shelby Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Shelby Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Shelby 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

Chap11/Shelby Solution/Shelby Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Shelby Project", "Shelby Project\Shelby Project.vbproj", "{D04EFA0C-1C5D-4C6F-A1CC-416F48CBFD9F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D04EFA0C-1C5D-4C6F-A1CC-416F48CBFD9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D04EFA0C-1C5D-4C6F-A1CC-416F48CBFD9F}.Debug|Any CPU.Build.0 = Debug|Any CPU {D04EFA0C-1C5D-4C6F-A1CC-416F48CBFD9F}.Release|Any CPU.ActiveCfg = Release|Any CPU {D04EFA0C-1C5D-4C6F-A1CC-416F48CBFD9F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/Sunshine Solution/Sunshine Project/App.config

Chap11/Sunshine Solution/Sunshine 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.txtCode = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.lblName = 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(13, 31) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(102, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Code (A or B):" ' 'txtCode ' Me.txtCode.Location = New System.Drawing.Point(17, 53) Me.txtCode.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtCode.Name = "txtCode" Me.txtCode.Size = New System.Drawing.Size(38, 27) Me.txtCode.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(137, 31) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(133, 20) Me.Label2.TabIndex = 4 Me.Label2.Text = "Department name:" ' 'lblName ' Me.lblName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblName.Location = New System.Drawing.Point(141, 53) Me.lblName.Name = "lblName" Me.lblName.Size = New System.Drawing.Size(157, 27) Me.lblName.TabIndex = 5 Me.lblName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnDisplay ' Me.btnDisplay.Location = New System.Drawing.Point(90, 120) Me.btnDisplay.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnDisplay.Name = "btnDisplay" Me.btnDisplay.Size = New System.Drawing.Size(101, 29) Me.btnDisplay.TabIndex = 2 Me.btnDisplay.Text = "&Display" Me.btnDisplay.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(197, 120) Me.btnExit.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(101, 29) 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(319, 183) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnDisplay) Me.Controls.Add(Me.lblName) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtCode) 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, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Department Codes" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtCode As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents lblName As System.Windows.Forms.Label Friend WithEvents btnDisplay As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap11/Sunshine Solution/Sunshine 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

Chap11/Sunshine Solution/Sunshine Project/frmMain.vb

' Name: Sunshine Project ' Purpose: Display the name of the department ' corresponding to a code ' 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 ' displays the department name Dim strCode As String ' assign user input to a variable strCode = txtCode.Text ' display department name Select Case strCode Case "A" lblName.Text = "Accounting" Case "B" lblName.Text = "Inventory" End Select End Sub End Class

Chap11/Sunshine Solution/Sunshine Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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.Sunshine_Project.frmMain End Sub End Class End Namespace

Chap11/Sunshine Solution/Sunshine 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>

Chap11/Sunshine Solution/Sunshine 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("Sunshine Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Sunshine Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("dc3c1a3f-3b88-4f94-9c8f-628850703200")> ' 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")>

Chap11/Sunshine Solution/Sunshine Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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("Sunshine_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

Chap11/Sunshine Solution/Sunshine 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

Chap11/Sunshine Solution/Sunshine Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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.Sunshine_Project.My.MySettings Get Return Global.Sunshine_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/Sunshine Solution/Sunshine Project/My Project/Settings.settings

Chap11/Sunshine Solution/Sunshine Project/Sunshine Project.vbproj

Debug AnyCPU {BA5212FC-B1AC-43BE-8158-D6354494E24D} WinExe Sunshine_Project.My.MyApplication Sunshine_Project Sunshine Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Sunshine Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Sunshine 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

Chap11/Sunshine Solution/Sunshine Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Sunshine Project", "Sunshine Project\Sunshine Project.vbproj", "{BA5212FC-B1AC-43BE-8158-D6354494E24D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {BA5212FC-B1AC-43BE-8158-D6354494E24D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BA5212FC-B1AC-43BE-8158-D6354494E24D}.Debug|Any CPU.Build.0 = Debug|Any CPU {BA5212FC-B1AC-43BE-8158-D6354494E24D}.Release|Any CPU.ActiveCfg = Release|Any CPU {BA5212FC-B1AC-43BE-8158-D6354494E24D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/SwatTheBugs Solution/SwatTheBugs Project/App.config

Chap11/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.lblBonus = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.btnExit = New System.Windows.Forms.Button() Me.txtSales = New System.Windows.Forms.TextBox() Me.Label1 = New System.Windows.Forms.Label() Me.btnCalc = New System.Windows.Forms.Button() Me.radCode1 = New System.Windows.Forms.RadioButton() Me.radCode2 = New System.Windows.Forms.RadioButton() Me.radCode3 = New System.Windows.Forms.RadioButton() Me.radCode4 = New System.Windows.Forms.RadioButton() Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' 'lblBonus ' Me.lblBonus.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblBonus.Location = New System.Drawing.Point(280, 53) Me.lblBonus.Name = "lblBonus" Me.lblBonus.Size = New System.Drawing.Size(103, 29) Me.lblBonus.TabIndex = 6 Me.lblBonus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(275, 29) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(52, 20) Me.Label2.TabIndex = 5 Me.Label2.Text = "Bonus:" ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(280, 180) Me.btnExit.Margin = New System.Windows.Forms.Padding(2) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(103, 32) Me.btnExit.TabIndex = 3 Me.btnExit.Text = "E&xit" ' 'txtSales ' Me.txtSales.Location = New System.Drawing.Point(137, 53) Me.txtSales.Margin = New System.Windows.Forms.Padding(2) Me.txtSales.Name = "txtSales" Me.txtSales.Size = New System.Drawing.Size(108, 27) Me.txtSales.TabIndex = 1 ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(133, 29) Me.Label1.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(101, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Sales amount:" ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(136, 180) Me.btnCalc.Margin = New System.Windows.Forms.Padding(2) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(131, 32) Me.btnCalc.TabIndex = 2 Me.btnCalc.Text = "&Calculate Bonus" ' 'radCode1 ' Me.radCode1.Checked = True Me.radCode1.Location = New System.Drawing.Point(16, 34) Me.radCode1.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.radCode1.Name = "radCode1" Me.radCode1.Size = New System.Drawing.Size(54, 22) Me.radCode1.TabIndex = 0 Me.radCode1.TabStop = True Me.radCode1.Text = "&1" Me.radCode1.UseVisualStyleBackColor = True ' 'radCode2 ' Me.radCode2.Location = New System.Drawing.Point(16, 74) Me.radCode2.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.radCode2.Name = "radCode2" Me.radCode2.Size = New System.Drawing.Size(54, 22) Me.radCode2.TabIndex = 1 Me.radCode2.Text = "&2" Me.radCode2.UseVisualStyleBackColor = True ' 'radCode3 ' Me.radCode3.Location = New System.Drawing.Point(16, 114) Me.radCode3.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.radCode3.Name = "radCode3" Me.radCode3.Size = New System.Drawing.Size(54, 22) Me.radCode3.TabIndex = 2 Me.radCode3.Text = "&3" Me.radCode3.UseVisualStyleBackColor = True ' 'radCode4 ' Me.radCode4.Location = New System.Drawing.Point(16, 154) Me.radCode4.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.radCode4.Name = "radCode4" Me.radCode4.Size = New System.Drawing.Size(54, 22) Me.radCode4.TabIndex = 3 Me.radCode4.Text = "&4" Me.radCode4.UseVisualStyleBackColor = True ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.radCode1) Me.GroupBox1.Controls.Add(Me.radCode4) Me.GroupBox1.Controls.Add(Me.radCode2) Me.GroupBox1.Controls.Add(Me.radCode3) Me.GroupBox1.Location = New System.Drawing.Point(29, 16) Me.GroupBox1.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Padding = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.GroupBox1.Size = New System.Drawing.Size(77, 200) Me.GroupBox1.TabIndex = 4 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Code" ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(409, 247) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.lblBonus) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.txtSales) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.btnCalc) 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 = "SwatTheBugs" Me.GroupBox1.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents lblBonus As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents txtSales As System.Windows.Forms.TextBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents radCode1 As System.Windows.Forms.RadioButton Friend WithEvents radCode2 As System.Windows.Forms.RadioButton Friend WithEvents radCode3 As System.Windows.Forms.RadioButton Friend WithEvents radCode4 As System.Windows.Forms.RadioButton Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox End Class

Chap11/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 True True

Chap11/SwatTheBugs Solution/SwatTheBugs Project/frmMain.vb

' Name: SwatTheBugs 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 Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates and displays a bonus amount Dim decSales As Decimal Dim decBonus As Decimal ' assign input to variables Decimal.TryParse(txtSales.Text, decSales) ' calculate bonus ' the bonus is 10% of the sales when the code is ' either 1 or 2 and the sales are over 10000 ' otherwise, the bonus is 5% If radCode1.Checked = True OrElse radCode2.Checked = True AndAlso decSales > 10000 Then decBonus = decSales * 0.1 Else decBonus = decSales * 0.05 End If ' display bonus lblBonus.Text = decBonus.ToString("C2") End Sub Private Sub txtSales_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtSales.KeyPress ' allows the text box to accept only numbers, the period, ' and the Backspace key for editing If e.KeyChar < "0" OrElse e.KeyChar > "9" AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub End Class

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

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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

Chap11/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>

Chap11/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("")> <Assembly: AssemblyProduct("SwatTheBugs Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("3822e51d-fe9d-4ec6-8e86-10349ef418c9")> ' 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")>

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

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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

Chap11/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

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

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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

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

Chap11/SwatTheBugs Solution/SwatTheBugs Project/SwatTheBugs Project.vbproj

Debug AnyCPU {82CBDBF9-4A78-481C-918A-96A483C229CF} 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

Chap11/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", "{82CBDBF9-4A78-481C-918A-96A483C229CF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {82CBDBF9-4A78-481C-918A-96A483C229CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {82CBDBF9-4A78-481C-918A-96A483C229CF}.Debug|Any CPU.Build.0 = Debug|Any CPU {82CBDBF9-4A78-481C-918A-96A483C229CF}.Release|Any CPU.ActiveCfg = Release|Any CPU {82CBDBF9-4A78-481C-918A-96A483C229CF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/Tiger Hotel Solution/Tiger Hotel Project/App.config

Chap11/Tiger Hotel Solution/Tiger Hotel 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.Label1 = New System.Windows.Forms.Label() Me.lblRate = New System.Windows.Forms.Label() Me.btnDisplay = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.Label2 = New System.Windows.Forms.Label() Me.txtType = New System.Windows.Forms.TextBox() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Tiger_Hotel_Project.My.Resources.Resources.Tiger Me.PictureBox1.Location = New System.Drawing.Point(13, 26) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(109, 81) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 0 Me.PictureBox1.TabStop = False ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(129, 87) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(76, 20) Me.Label1.TabIndex = 4 Me.Label1.Text = "Daily rate:" ' 'lblRate ' Me.lblRate.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblRate.Location = New System.Drawing.Point(211, 83) Me.lblRate.Name = "lblRate" Me.lblRate.Size = New System.Drawing.Size(84, 29) Me.lblRate.TabIndex = 5 Me.lblRate.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnDisplay ' Me.btnDisplay.Location = New System.Drawing.Point(301, 83) Me.btnDisplay.Name = "btnDisplay" Me.btnDisplay.Size = New System.Drawing.Size(110, 29) Me.btnDisplay.TabIndex = 2 Me.btnDisplay.Text = "Display &Rate" Me.btnDisplay.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(417, 83) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(76, 29) Me.btnExit.TabIndex = 3 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(129, 26) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(247, 20) Me.Label2.TabIndex = 0 Me.Label2.Text = "&Room type - S(tandard) or D(eluxe):" ' 'txtType ' Me.txtType.Location = New System.Drawing.Point(382, 23) Me.txtType.Name = "txtType" Me.txtType.Size = New System.Drawing.Size(36, 27) Me.txtType.TabIndex = 1 ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(513, 150) Me.Controls.Add(Me.txtType) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnDisplay) Me.Controls.Add(Me.lblRate) Me.Controls.Add(Me.Label1) 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 = "Tiger Hotel" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents lblRate As System.Windows.Forms.Label Friend WithEvents btnDisplay As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtType As System.Windows.Forms.TextBox End Class

Chap11/Tiger Hotel Solution/Tiger Hotel 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

Chap11/Tiger Hotel Solution/Tiger Hotel Project/frmMain.vb

' Name: Tiger Hotel Project ' Purpose: Display the daily rate ' 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 ' displays a room's daily rate Dim strType As String Dim intRate As Integer strType = txtType.Text.ToUpper If strType = "S" Then intRate = 90 Else If strType = "D" Then intRate = 115 End If End If lblRate.Text = intRate.ToString("C0") End Sub End Class

Chap11/Tiger Hotel Solution/Tiger Hotel 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.Tiger_Hotel_Project.frmMain End Sub End Class End Namespace

Chap11/Tiger Hotel Solution/Tiger Hotel 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>

Chap11/Tiger Hotel Solution/Tiger Hotel 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("Tiger Hotel Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("Tiger Hotel 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("76557374-542c-4b81-b1aa-1d3517825d68")> ' 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")>

Chap11/Tiger Hotel Solution/Tiger Hotel 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("Tiger_Hotel_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 Tiger() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Tiger", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace

Chap11/Tiger Hotel Solution/Tiger Hotel 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\Tiger.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Chap11/Tiger Hotel Solution/Tiger Hotel 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.Tiger_Hotel_Project.My.MySettings Get Return Global.Tiger_Hotel_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/Tiger Hotel Solution/Tiger Hotel Project/My Project/Settings.settings

Chap11/Tiger Hotel Solution/Tiger Hotel Project/Resources/Tiger.png

Chap11/Tiger Hotel Solution/Tiger Hotel Project/Tiger Hotel Project.vbproj

Debug AnyCPU {8348BC18-36D0-4E85-A721-C0D170FE2F0E} WinExe Tiger_Hotel_Project.My.MyApplication Tiger_Hotel_Project Tiger Hotel Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Tiger Hotel Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Tiger Hotel 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

Chap11/Tiger Hotel Solution/Tiger Hotel Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Tiger Hotel Project", "Tiger Hotel Project\Tiger Hotel Project.vbproj", "{8348BC18-36D0-4E85-A721-C0D170FE2F0E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {8348BC18-36D0-4E85-A721-C0D170FE2F0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8348BC18-36D0-4E85-A721-C0D170FE2F0E}.Debug|Any CPU.Build.0 = Debug|Any CPU {8348BC18-36D0-4E85-A721-C0D170FE2F0E}.Release|Any CPU.ActiveCfg = Release|Any CPU {8348BC18-36D0-4E85-A721-C0D170FE2F0E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/Tiger Hotel Solution-Version 2/Tiger Hotel Project/App.config

Chap11/Tiger Hotel Solution-Version 2/Tiger Hotel 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.Label1 = New System.Windows.Forms.Label() Me.lblRate = New System.Windows.Forms.Label() Me.btnDisplay = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.Label2 = New System.Windows.Forms.Label() Me.txtType = New System.Windows.Forms.TextBox() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Tiger_Hotel_Project.My.Resources.Resources.Tiger Me.PictureBox1.Location = New System.Drawing.Point(13, 26) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(109, 81) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 0 Me.PictureBox1.TabStop = False ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(129, 87) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(76, 20) Me.Label1.TabIndex = 4 Me.Label1.Text = "Daily rate:" ' 'lblRate ' Me.lblRate.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblRate.Location = New System.Drawing.Point(211, 83) Me.lblRate.Name = "lblRate" Me.lblRate.Size = New System.Drawing.Size(84, 29) Me.lblRate.TabIndex = 5 Me.lblRate.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnDisplay ' Me.btnDisplay.Location = New System.Drawing.Point(301, 83) Me.btnDisplay.Name = "btnDisplay" Me.btnDisplay.Size = New System.Drawing.Size(110, 29) Me.btnDisplay.TabIndex = 2 Me.btnDisplay.Text = "Display &Rate" Me.btnDisplay.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(417, 83) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(76, 29) Me.btnExit.TabIndex = 3 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(129, 26) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(247, 20) Me.Label2.TabIndex = 0 Me.Label2.Text = "&Room type - S(tandard) or D(eluxe):" ' 'txtType ' Me.txtType.Location = New System.Drawing.Point(382, 23) Me.txtType.Name = "txtType" Me.txtType.Size = New System.Drawing.Size(36, 27) Me.txtType.TabIndex = 1 ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(513, 150) Me.Controls.Add(Me.txtType) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnDisplay) Me.Controls.Add(Me.lblRate) Me.Controls.Add(Me.Label1) 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 = "Tiger Hotel" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents lblRate As System.Windows.Forms.Label Friend WithEvents btnDisplay As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtType As System.Windows.Forms.TextBox End Class

Chap11/Tiger Hotel Solution-Version 2/Tiger Hotel 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

Chap11/Tiger Hotel Solution-Version 2/Tiger Hotel Project/frmMain.vb

' Name: Tiger Hotel Project ' Purpose: Display the daily rate ' 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 ' displays a room's daily rate Dim strType As String Dim intRate As Integer strType = txtType.Text.ToUpper.Trim If strType = "S" Then intRate = 90 Else If strType = "D" Then intRate = 115 Else MessageBox.Show("Please enter a valid room type.", "Tiger Hotel", MessageBoxButtons.OK, MessageBoxIcon.Information) End If End If lblRate.Text = intRate.ToString("C0") End Sub End Class

Chap11/Tiger Hotel Solution-Version 2/Tiger Hotel 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.Tiger_Hotel_Project.frmMain End Sub End Class End Namespace

Chap11/Tiger Hotel Solution-Version 2/Tiger Hotel 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>

Chap11/Tiger Hotel Solution-Version 2/Tiger Hotel 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("Tiger Hotel Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Toshiba")> <Assembly: AssemblyProduct("Tiger Hotel 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("76557374-542c-4b81-b1aa-1d3517825d68")> ' 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")>

Chap11/Tiger Hotel Solution-Version 2/Tiger Hotel 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("Tiger_Hotel_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 Tiger() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Tiger", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace

Chap11/Tiger Hotel Solution-Version 2/Tiger Hotel 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\Tiger.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Chap11/Tiger Hotel Solution-Version 2/Tiger Hotel 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.Tiger_Hotel_Project.My.MySettings Get Return Global.Tiger_Hotel_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/Tiger Hotel Solution-Version 2/Tiger Hotel Project/My Project/Settings.settings

Chap11/Tiger Hotel Solution-Version 2/Tiger Hotel Project/Resources/Tiger.png

Chap11/Tiger Hotel Solution-Version 2/Tiger Hotel Project/Tiger Hotel Project.vbproj

Debug AnyCPU {8348BC18-36D0-4E85-A721-C0D170FE2F0E} WinExe Tiger_Hotel_Project.My.MyApplication Tiger_Hotel_Project Tiger Hotel Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Tiger Hotel Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Tiger Hotel 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

Chap11/Tiger Hotel Solution-Version 2/Tiger Hotel Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Tiger Hotel Project", "Tiger Hotel Project\Tiger Hotel Project.vbproj", "{8348BC18-36D0-4E85-A721-C0D170FE2F0E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {8348BC18-36D0-4E85-A721-C0D170FE2F0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8348BC18-36D0-4E85-A721-C0D170FE2F0E}.Debug|Any CPU.Build.0 = Debug|Any CPU {8348BC18-36D0-4E85-A721-C0D170FE2F0E}.Release|Any CPU.ActiveCfg = Release|Any CPU {8348BC18-36D0-4E85-A721-C0D170FE2F0E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

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

Chap11/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.Label2 = New System.Windows.Forms.Label() Me.txtQuantity = New System.Windows.Forms.TextBox() Me.txtPrice = New System.Windows.Forms.TextBox() Me.Label4 = 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.chkEmployee = New System.Windows.Forms.CheckBox() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(29, 29) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(68, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Quantity:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(128, 29) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(44, 20) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Price:" ' 'txtQuantity ' Me.txtQuantity.Location = New System.Drawing.Point(29, 54) Me.txtQuantity.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtQuantity.Name = "txtQuantity" Me.txtQuantity.Size = New System.Drawing.Size(47, 27) Me.txtQuantity.TabIndex = 1 ' 'txtPrice ' Me.txtPrice.Location = New System.Drawing.Point(131, 54) Me.txtPrice.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtPrice.Name = "txtPrice" Me.txtPrice.Size = New System.Drawing.Size(73, 27) Me.txtPrice.TabIndex = 3 ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(29, 121) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(75, 20) Me.Label4.TabIndex = 7 Me.Label4.Text = "Total due:" ' 'lblTotal ' Me.lblTotal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblTotal.Location = New System.Drawing.Point(33, 141) Me.lblTotal.Name = "lblTotal" Me.lblTotal.Size = New System.Drawing.Size(171, 31) Me.lblTotal.TabIndex = 8 Me.lblTotal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(239, 98) Me.btnCalc.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(97, 36) Me.btnCalc.TabIndex = 5 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(239, 142) Me.btnExit.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(97, 36) 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(239, 29) Me.chkEmployee.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) 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(366, 218) Me.Controls.Add(Me.chkEmployee) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblTotal) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.txtPrice) Me.Controls.Add(Me.txtQuantity) 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(3, 6, 3, 6) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Total Due 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 txtQuantity As System.Windows.Forms.TextBox Friend WithEvents txtPrice As System.Windows.Forms.TextBox Friend WithEvents Label4 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 chkEmployee As System.Windows.Forms.CheckBox End Class

Chap11/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 True True True True True True True True True True

Chap11/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 decSubtotal = intQuantity * decPrice If chkEmployee.Checked = True Then decDiscount = decSubtotal * decDISC_RATE Else decDiscount = 0 End If decTotal = decSubtotal - decDiscount ' display total due lblTotal.Text = decTotal.ToString("C2") End Sub End Class

Chap11/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.18010 ' ' 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

Chap11/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>

Chap11/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 © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("ef4f6d68-52aa-4944-91f6-aecc0ab5d703")> ' 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")>

Chap11/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.18010 ' ' 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

Chap11/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

Chap11/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.18010 ' ' 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

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

Chap11/Total Due Solution/Total Due Project/Total Due Project.vbproj

Debug AnyCPU {A81A21DD-262F-4AFF-936B-7A72109E743C} 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

Chap11/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", "{A81A21DD-262F-4AFF-936B-7A72109E743C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {A81A21DD-262F-4AFF-936B-7A72109E743C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A81A21DD-262F-4AFF-936B-7A72109E743C}.Debug|Any CPU.Build.0 = Debug|Any CPU {A81A21DD-262F-4AFF-936B-7A72109E743C}.Release|Any CPU.ActiveCfg = Release|Any CPU {A81A21DD-262F-4AFF-936B-7A72109E743C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Chap11/XYZ Solution/XYZ Project/App.config

Chap11/XYZ Solution/XYZ 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.txtTotalPrice = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.lblShipping = 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(13, 15) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(73, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Total price:" ' 'txtTotalPrice ' Me.txtTotalPrice.Location = New System.Drawing.Point(17, 35) Me.txtTotalPrice.Name = "txtTotalPrice" Me.txtTotalPrice.Size = New System.Drawing.Size(79, 25) Me.txtTotalPrice.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(129, 15) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(106, 17) Me.Label2.TabIndex = 4 Me.Label2.Text = "Shipping charge:" ' 'lblShipping ' Me.lblShipping.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblShipping.Font = New System.Drawing.Font("Segoe UI", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblShipping.Location = New System.Drawing.Point(133, 35) Me.lblShipping.Name = "lblShipping" Me.lblShipping.Size = New System.Drawing.Size(102, 37) Me.lblShipping.TabIndex = 5 Me.lblShipping.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnDisplay ' Me.btnDisplay.Location = New System.Drawing.Point(17, 92) Me.btnDisplay.Name = "btnDisplay" Me.btnDisplay.Size = New System.Drawing.Size(122, 28) Me.btnDisplay.TabIndex = 2 Me.btnDisplay.Text = "&Display Shipping" Me.btnDisplay.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(145, 92) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(90, 28) Me.btnExit.TabIndex = 3 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(257, 148) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnDisplay) Me.Controls.Add(Me.lblShipping) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtTotalPrice) 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 = "XYZ" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtTotalPrice As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents lblShipping As System.Windows.Forms.Label Friend WithEvents btnDisplay As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class

Chap11/XYZ Solution/XYZ 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

Chap11/XYZ Solution/XYZ Project/frmMain.vb

' Name: XYZ Project ' Purpose: Display a shipping charge that is based on the total price ' 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 ' displays a shipping charge ' Total price Shipping ($) ' 01 - 75 3.99 ' 75.01 - 100 1.99 ' Over 100 0 Dim decTotalPrice As Decimal Dim decShipping As Decimal ' assign total price to a variable Decimal.TryParse(txtTotalPrice.Text, decTotalPrice) ' assign shipping charge Select Case decTotalPrice Case Is <= 75 decShipping = 3.99 Case Is <= 100 decShipping = 1.99 Case Else decShipping = 0 End Select ' display shipping charge lblShipping.Text = decShipping.ToString("C2") End Sub Private Sub txtTotalPrice_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtTotalPrice.KeyPress ' accept only numbers, the period, and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub End Class

Chap11/XYZ Solution/XYZ Project/My Project/Application.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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.XYZ_Project.frmMain End Sub End Class End Namespace

Chap11/XYZ Solution/XYZ 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>

Chap11/XYZ Solution/XYZ 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("XYZ Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("XYZ Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("a8dc565f-37a8-4a27-99be-a3bc4ca23c15")> ' 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")>

Chap11/XYZ Solution/XYZ Project/My Project/Resources.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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("XYZ_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

Chap11/XYZ Solution/XYZ 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

Chap11/XYZ Solution/XYZ Project/My Project/Settings.Designer.vb

'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' 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.XYZ_Project.My.MySettings Get Return Global.XYZ_Project.My.MySettings.Default End Get End Property End Module End Namespace

Chap11/XYZ Solution/XYZ Project/My Project/Settings.settings

Chap11/XYZ Solution/XYZ Project/XYZ Project.vbproj

Debug AnyCPU {1099C3C8-A819-4439-B875-635A3BFD3ABF} WinExe XYZ_Project.My.MyApplication XYZ_Project XYZ Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ XYZ Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ XYZ 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

Chap11/XYZ Solution/XYZ Solution.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "XYZ Project", "XYZ Project\XYZ Project.vbproj", "{1099C3C8-A819-4439-B875-635A3BFD3ABF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {1099C3C8-A819-4439-B875-635A3BFD3ABF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1099C3C8-A819-4439-B875-635A3BFD3ABF}.Debug|Any CPU.Build.0 = Debug|Any CPU {1099C3C8-A819-4439-B875-635A3BFD3ABF}.Release|Any CPU.ActiveCfg = Release|Any CPU {1099C3C8-A819-4439-B875-635A3BFD3ABF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal