VB CoderToHelpU
State Capitals Solution.zip
State Capitals Solution/State Capitals Project/App.config
State Capitals Solution/State Capitals Project/Main Form.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.lstCapsAndStates = New System.Windows.Forms.ListBox() 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(23, 25) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(121, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Capitals and states:" ' 'lstCapsAndStates ' Me.lstCapsAndStates.FormattingEnabled = True Me.lstCapsAndStates.ItemHeight = 17 Me.lstCapsAndStates.Location = New System.Drawing.Point(26, 45) Me.lstCapsAndStates.Name = "lstCapsAndStates" Me.lstCapsAndStates.Size = New System.Drawing.Size(151, 89) Me.lstCapsAndStates.TabIndex = 1 ' 'btnDisplay ' Me.btnDisplay.Location = New System.Drawing.Point(226, 25) Me.btnDisplay.Name = "btnDisplay" Me.btnDisplay.Size = New System.Drawing.Size(75, 28) Me.btnDisplay.TabIndex = 2 Me.btnDisplay.Text = "&Display" Me.btnDisplay.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(226, 59) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(75, 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(325, 165) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnDisplay) Me.Controls.Add(Me.lstCapsAndStates) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "State Capitals" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents lstCapsAndStates As System.Windows.Forms.ListBox Friend WithEvents btnDisplay As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class
State Capitals Solution/State Capitals Project/Main Form.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
State Capitals Solution/State Capitals Project/Main Form.vb
' Name: State Capitals Project ' Purpose: Display a capital name followed by a comma, ' a space, and the state name ' Programmer: <your name> on <current date> Option Explicit On Option Strict On Option Infer Off Public Class frmMain Private strStates() As String = {"Alabama", "Arizona", "California", "Georgia", "Tennessee"} Private strCapitals() As String = {"Montgomery", "Phoenix", "Sacramento", "Atlanta", "Nashville"} 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 contents of the arrays using this format: capital, state lstCapsAndStates.Items.Clear() End Sub End Class
State Capitals Solution/State Capitals 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.State_Capitals_Project.frmMain End Sub End Class End Namespace
State Capitals Solution/State Capitals 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>
State Capitals Solution/State Capitals 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("State Capitals Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("State Capitals Project")> <Assembly: AssemblyCopyright("Copyright © 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("dbf916f2-941f-485b-b8d4-11e656dea62f")> ' 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")>
State Capitals Solution/State Capitals 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("State_Capitals_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
State Capitals Solution/State Capitals 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
State Capitals Solution/State Capitals 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.State_Capitals_Project.My.MySettings Get Return Global.State_Capitals_Project.My.MySettings.Default End Get End Property End Module End Namespace
State Capitals Solution/State Capitals Project/My Project/Settings.settings
State Capitals Solution/State Capitals Project/State Capitals Project.vbproj
Debug AnyCPU {E4FA367C-70C3-4683-9C00-2F3F9C904F45} WinExe State_Capitals_Project.My.MyApplication State_Capitals_Project State Capitals Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ State Capitals Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ State Capitals Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form Main Form.vb Form True Application.myapp True True Resources.resx True Settings.settings True Main Form.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb
State Capitals Solution/State Capitals Solution.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "State Capitals Project", "State Capitals Project\State Capitals Project.vbproj", "{E4FA367C-70C3-4683-9C00-2F3F9C904F45}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E4FA367C-70C3-4683-9C00-2F3F9C904F45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E4FA367C-70C3-4683-9C00-2F3F9C904F45}.Debug|Any CPU.Build.0 = Debug|Any CPU {E4FA367C-70C3-4683-9C00-2F3F9C904F45}.Release|Any CPU.ActiveCfg = Release|Any CPU {E4FA367C-70C3-4683-9C00-2F3F9C904F45}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
LessonA.JPG
LessonB.JPG
LessonC.JPG
READ FOR WHAT TO DO.docx
Chapter 9 Visual Basic
For all:
· provide appropriate names for your solution and project.
· include an informational comment block in the General Declarations section of your code.
· Chapter / Exercise (ie. Chapter 9 Exercise A, or Exercise 9a)
· A brief description of the program
· provide appropriate names to all objects that are referenced in the code.
· provide any necessary user-friendly/aesthetic adjustments to the interface.
· zip/archive your solution folder for submitting.
Lesson A:
It’s #1, view the image for what to do.
Lesson B:
It’s #3, view the image for what to do. The template is in the folder.
Lesson C:
It’s #1, view the image for what to do.
Six Question Quiz (answer it in a word doc or just bold the answer here, it’s up to you):
Question 1 (1 point)
Each menu in an application does not have to contain a menu title.
Question 1 options:
True
False
Question 2 (1 point)
If an application expects the user to enter a seven-digit phone number or a five-digit ZIP code, the application’s code should verify that the user entered the required number of characters.
Question 2 options:
True
False
Question 3 (1 point)
You should assign shortcut keys to every menu item.
Question 3 options:
True
False
Question 4 (2 points)
The ____ method returns an integer that represents the location of the subString within the string.
Question 4 options:
Insert
IndexOf
Contains
Substring
Question 5 (2 points)Assume that the value of the string message is "Happy New Year". What value would message.IndexOf("New") yield?
Question 5 options:
-1
2
6
7
Question 6 (2 points)
You can use the ____ method to search a string to determine whether it contains a specific sequence of characters.
Question 6 options:
Contains
Insert
Substring
IndexOf