SlideShare a Scribd company logo
Microsoft Visual Basic 2010



CHAPTER THREE

 Program Design and Coding
3      Objectives

  ►Change the BackColor property of an object
  ►Understand Visual Basic 2010 code statement formats
  ►Use IntelliSense to enter Visual Basic 2010 code
   statements
  ►Correct errors in Visual Basic 2010 code
  ►Write code for an object
  ►Print code
  ►Prepare an Event Planning Document



Chapter 3: Program Design and Coding                     2
3      BackColor Property

  ►Click the Windows Form object to select it
  ►If necessary, scroll in the Properties window until the
   BackColor property is displayed, and then click the
   right column of the BackColor property
  ►Click the BackColor arrow. Then, if necessary, click
   the Web tab to display the Web tabbed page
  ►Scroll to display the color you wish to apply
  ►Click the color you wish to apply on the color list



Chapter 3: Program Design and Coding                         3
3      BackColor Property




Chapter 3: Program Design and Coding   4
3      Sizing an Image

  ►With the PictureBox object containing the
   StandardRoom image selected, scroll in the
   picStandardRoom Properties window until you see the
   SizeMode property. Click the SizeMode property
   name in the left column and then click the SizeMode
   arrow in the right column of the SizeMode property
  ►Click StretchImage in the SizeMode list




Chapter 3: Program Design and Coding                     5
3      Sizing an Image




Chapter 3: Program Design and Coding   6
3      Running a Program

  ►Point to the Start Debugging button on the Standard
   toolbar
  ►Click the Start Debugging button on the Standard
   toolbar




Chapter 3: Program Design and Coding                     7
3      Entering Visual Basic Code for Event Handling

  ►With Visual Studio 2010 and the Hotel Room Selection
   program open and the frmHotelRoomSelection.vb
   [Design] tabbed window visible, point to the Standard
   Room Button object in the Windows Form object
  ►Double-click the Standard Room Button object




Chapter 3: Program Design and Coding                       8
3      Entering Visual Basic Code for Event Handling




Chapter 3: Program Design and Coding                     9
3      Visual Basic 2010 Coding Statements

  ►The Visual Basic syntax specifies how each statement
   must be written
  ►When the user clicks the Standard Room button while
   the program is running, the standard room image
   should be displayed in the picStandardRoom
   PictureBox object




Chapter 3: Program Design and Coding                      10
3      General Format of a Visual Basic Statement




Chapter 3: Program Design and Coding                  11
3      IntelliSense

  ►IntelliSense displays all allowable entries you can
   make in a Visual Basic statement each time a dot
   (period), equal sign, or other special character
   required for the statement is typed




Chapter 3: Program Design and Coding                     12
3      Entering a Visual Basic Statement
  ► With the code window open and the insertion point positioned
    as shown in Figure 3-25 on page 131, type pic followed by a
    period
  ► To identify the correct entry, type the first letters of the entry
    until the entry is selected. In this case, type s on your keyboard
  ► When IntelliSense highlights the correct object name, press the
    key on the keyboard corresponding to the entry that is to
    follow the object name. In this case, press the PERIOD key
  ► As with the object name in the second step, the next step is to
    enter one or more characters until IntelliSense highlights the
    desired property in the list. Type the letter, v on your keyboard




Chapter 3: Program Design and Coding                                     13
3      Entering a Visual Basic Statement

  ►Press the key for the character that is to follow the
   property name. In this case, press the SPACEBAR on
   the keyboard
  ►Press the EQUAL SIGN key on the keyboard and then
   press the SPACEBAR. On the IntelliSense list, click the
   Common tab to display the most common results
  ►Type t on the keyboard
  ►Press the key for the character that is to follow the
   True entry. In this case, press the ENTER key


Chapter 3: Program Design and Coding                         14
3      Comments in Program Statements

  ►To insert a blank line following the event code
   generated by Visual Studio that begins with the word,
   Private, click anywhere in that line and then press the
   END key on your keyboard
  ►Press the ENTER key
  ►Type the first line of the comments, beginning with an
   apostrophe, as shown in Figure 3-46 on page 143, and
   then press the ENTER key




Chapter 3: Program Design and Coding                         15
3      Comments in Program Statements




Chapter 3: Program Design and Coding      16
3      Same Line Comments




Chapter 3: Program Design and Coding   17
3      Introductory Comments

  ►Click to the left of the word, Public, on line 1 in the
   program to place the insertion point on that line
  ►Press the ENTER key one time, and then press the UP
   ARROW key one time
  ►Type an apostrophe, a space, the text, Program
   Name: and then press the TAB key one time
  ►Type Hotel Room Selection as the name of the
   program. Then, press the ENTER key




Chapter 3: Program Design and Coding                         18
3      Introductory Comments




Chapter 3: Program Design and Coding   19
3      Correcting Errors in Code

  ►Using IntelliSense reduces the likelihood of coding
   errors considerably, although it is still possible to code
   an error
    • One possible error may be forgetting an
      apostrophe in a comment statement
  ►A build errors message means the Visual Basic
   compiler detected a coding error in the program




Chapter 3: Program Design and Coding                            20
3      Correcting Errors in Code




Chapter 3: Program Design and Coding   21
3      Correcting Errors in Code

  ►Click the No button in the Microsoft Visual Studio
   dialog box that informs you of a build error
  ►Double-click anywhere on the error line
  ►Click in the leftmost column on line 7 to place the
   insertion point at that location
  ►Type an apostrophe
  ►Click anywhere in the code editing window




Chapter 3: Program Design and Coding                     22
3      Correcting Errors in Code




Chapter 3: Program Design and Coding   23
3      Additional Click Events

  ►On the frmHotelRoomSelection.vb [Design] tabbed
   page, double-click the Exit Window Button object




Chapter 3: Program Design and Coding                  24
3      Close Procedure

  ►With the insertion point positioned as shown in Figure
   3-64 on page 154, type clo to highlight Close in the
   IntelliSense list
  ►Press the ENTER key




Chapter 3: Program Design and Coding                        25
3      Printing Code
  ►Click File on the menu bar to display the File menu
  ►Click Print on the File menu to display the Print dialog
   box
  ►Ensure that a check mark appears in the Include line
   numbers check box if you want line numbers on your
   printout. Most developers prefer line numbers on
   printouts
  ►Make any other selections you find necessary in the
   Print dialog box
  ►Click the OK button in the Print dialog box to print the
   code

Chapter 3: Program Design and Coding                          26
3      Event Planning Document




Chapter 3: Program Design and Coding   27
3      Phase 4 – Code the Program

  ►After the events and tasks within the vents have been
   identified, the developer is ready to code the program
    • Entering Visual Basic statements to accomplish the
      tasks specified on the event planning document
  ►Developer enters the code and implements the logic




Chapter 3: Program Design and Coding                        28
Microsoft Visual Basic 2010


CHAPTER THREE
   COMPLETE
 Program Design and Coding

More Related Content

What's hot

Vb introduction.
Vb introduction.Vb introduction.
Vb introduction.
sagaroceanic11
 
Chapter 3 — Program Design and Coding
Chapter 3 — Program Design and Coding Chapter 3 — Program Design and Coding
Chapter 3 — Program Design and Coding
francopw
 
Vb basics
Vb basicsVb basics
Vb basics
sagaroceanic11
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
Ahllen Javier
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
Ranjuma Shubhangi
 
Visual Programming
Visual ProgrammingVisual Programming
Visual Programming
Bagzzz
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
sanket1996
 
visual basic programming
visual basic programmingvisual basic programming
visual basic programming
sowndaryadharmaraj
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programming
Roger Argarin
 
Visual basic
Visual basicVisual basic
Visual basic
umesh patil
 
Visual Basic Programming
Visual Basic ProgrammingVisual Basic Programming
Visual Basic Programming
Osama Yaseen
 
Visual basic
Visual basicVisual basic
Visual basic
Dharmik
 
Chapter03 Ppt
Chapter03 PptChapter03 Ppt
Chapter03 Ppt
Osama Yaseen
 
visual basic v6 introduction
visual basic v6 introductionvisual basic v6 introduction
visual basic v6 introduction
bloodyedge03
 
Chapter 01: Intro to VB2010 Programming
Chapter 01: Intro to VB2010 ProgrammingChapter 01: Intro to VB2010 Programming
Chapter 01: Intro to VB2010 Programming
patf719
 
visual basic for the beginner
visual basic for the beginnervisual basic for the beginner
visual basic for the beginner
Salim M
 
Vp lecture1 ararat
Vp lecture1 araratVp lecture1 ararat
Vp lecture1 ararat
Saman M. Almufti
 
Visual basic 6 black book
Visual basic 6 black bookVisual basic 6 black book
Visual basic 6 black book
Ajay Goyal
 
Visual programming
Visual programmingVisual programming
Visual programming
Dr. C.V. Suresh Babu
 
Best practices for upgrading vb 6.0 projects to vb.net
Best practices for upgrading vb 6.0 projects to vb.netBest practices for upgrading vb 6.0 projects to vb.net
Best practices for upgrading vb 6.0 projects to vb.net
ajmal_fuuast
 

What's hot (20)

Vb introduction.
Vb introduction.Vb introduction.
Vb introduction.
 
Chapter 3 — Program Design and Coding
Chapter 3 — Program Design and Coding Chapter 3 — Program Design and Coding
Chapter 3 — Program Design and Coding
 
Vb basics
Vb basicsVb basics
Vb basics
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
 
Visual Programming
Visual ProgrammingVisual Programming
Visual Programming
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
 
visual basic programming
visual basic programmingvisual basic programming
visual basic programming
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programming
 
Visual basic
Visual basicVisual basic
Visual basic
 
Visual Basic Programming
Visual Basic ProgrammingVisual Basic Programming
Visual Basic Programming
 
Visual basic
Visual basicVisual basic
Visual basic
 
Chapter03 Ppt
Chapter03 PptChapter03 Ppt
Chapter03 Ppt
 
visual basic v6 introduction
visual basic v6 introductionvisual basic v6 introduction
visual basic v6 introduction
 
Chapter 01: Intro to VB2010 Programming
Chapter 01: Intro to VB2010 ProgrammingChapter 01: Intro to VB2010 Programming
Chapter 01: Intro to VB2010 Programming
 
visual basic for the beginner
visual basic for the beginnervisual basic for the beginner
visual basic for the beginner
 
Vp lecture1 ararat
Vp lecture1 araratVp lecture1 ararat
Vp lecture1 ararat
 
Visual basic 6 black book
Visual basic 6 black bookVisual basic 6 black book
Visual basic 6 black book
 
Visual programming
Visual programmingVisual programming
Visual programming
 
Best practices for upgrading vb 6.0 projects to vb.net
Best practices for upgrading vb 6.0 projects to vb.netBest practices for upgrading vb 6.0 projects to vb.net
Best practices for upgrading vb 6.0 projects to vb.net
 

Viewers also liked

Visual Basic Calculator
Visual Basic CalculatorVisual Basic Calculator
Visual Basic Calculator
Spy Seat
 
Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming
francopw
 
Basic calculator tutorial
Basic calculator tutorialBasic calculator tutorial
Basic calculator tutorial
Gilkye
 
Chapter 4 — Variables and Arithmetic Operations
Chapter 4 — Variables and Arithmetic OperationsChapter 4 — Variables and Arithmetic Operations
Chapter 4 — Variables and Arithmetic Operations
francopw
 
Calculator and how to make it using VB 6.0
Calculator and how to make it using VB 6.0Calculator and how to make it using VB 6.0
Calculator and how to make it using VB 6.0
surajkumarpadhy
 
Visual Basic Codes And Screen Designs
Visual Basic Codes And Screen DesignsVisual Basic Codes And Screen Designs
Visual Basic Codes And Screen Designs
prcastano
 
CMD in 2013
CMD in 2013CMD in 2013
CMD in 2013
Jurriaan Mous
 
12 Reasons Why Hot Entrepreneurs Fail
12 Reasons Why Hot Entrepreneurs Fail12 Reasons Why Hot Entrepreneurs Fail
12 Reasons Why Hot Entrepreneurs Fail
Dix & Pond Consulting LLC
 
Ejer calc basico
Ejer calc basicoEjer calc basico
Ejer calc basico
Daniel Fernando Torres
 
Prg1 clases01
Prg1 clases01Prg1 clases01
Prg1 clases01
Jorge Juárez
 
VB Codes
VB CodesVB Codes
VB Codes
prcastano
 
Ejercicios writer1
Ejercicios writer1Ejercicios writer1
Ejercicios writer1
Derechos Humanos
 
Curso vb2010L1
Curso vb2010L1Curso vb2010L1
Curso vb2010L1
Juan Islas
 
Examen writer
Examen writerExamen writer
Examen writer
UTE
 
Ejercicios de open office writer
Ejercicios de open office writerEjercicios de open office writer
Ejercicios de open office writer
joseandresmateos
 
C# guia total del programador freelibros.org
C# guia total del programador freelibros.orgC# guia total del programador freelibros.org
C# guia total del programador freelibros.org
Koffe Revolution
 
Introduction to Processing and creative coding
Introduction to Processing and creative codingIntroduction to Processing and creative coding
Introduction to Processing and creative coding
Jerome Herr
 
Ejercicios writer
Ejercicios writerEjercicios writer
Ejercicios writer
guadalinfobornos
 
Writing Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdWriting Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::Cmd
Ricardo Signes
 
Visual studio 2010
Visual studio 2010Visual studio 2010
Visual studio 2010
Fitira
 

Viewers also liked (20)

Visual Basic Calculator
Visual Basic CalculatorVisual Basic Calculator
Visual Basic Calculator
 
Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming
 
Basic calculator tutorial
Basic calculator tutorialBasic calculator tutorial
Basic calculator tutorial
 
Chapter 4 — Variables and Arithmetic Operations
Chapter 4 — Variables and Arithmetic OperationsChapter 4 — Variables and Arithmetic Operations
Chapter 4 — Variables and Arithmetic Operations
 
Calculator and how to make it using VB 6.0
Calculator and how to make it using VB 6.0Calculator and how to make it using VB 6.0
Calculator and how to make it using VB 6.0
 
Visual Basic Codes And Screen Designs
Visual Basic Codes And Screen DesignsVisual Basic Codes And Screen Designs
Visual Basic Codes And Screen Designs
 
CMD in 2013
CMD in 2013CMD in 2013
CMD in 2013
 
12 Reasons Why Hot Entrepreneurs Fail
12 Reasons Why Hot Entrepreneurs Fail12 Reasons Why Hot Entrepreneurs Fail
12 Reasons Why Hot Entrepreneurs Fail
 
Ejer calc basico
Ejer calc basicoEjer calc basico
Ejer calc basico
 
Prg1 clases01
Prg1 clases01Prg1 clases01
Prg1 clases01
 
VB Codes
VB CodesVB Codes
VB Codes
 
Ejercicios writer1
Ejercicios writer1Ejercicios writer1
Ejercicios writer1
 
Curso vb2010L1
Curso vb2010L1Curso vb2010L1
Curso vb2010L1
 
Examen writer
Examen writerExamen writer
Examen writer
 
Ejercicios de open office writer
Ejercicios de open office writerEjercicios de open office writer
Ejercicios de open office writer
 
C# guia total del programador freelibros.org
C# guia total del programador freelibros.orgC# guia total del programador freelibros.org
C# guia total del programador freelibros.org
 
Introduction to Processing and creative coding
Introduction to Processing and creative codingIntroduction to Processing and creative coding
Introduction to Processing and creative coding
 
Ejercicios writer
Ejercicios writerEjercicios writer
Ejercicios writer
 
Writing Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdWriting Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::Cmd
 
Visual studio 2010
Visual studio 2010Visual studio 2010
Visual studio 2010
 

Similar to Chapter 03 - Program Coding and Design

Chapter 03
Chapter 03Chapter 03
Chapter 03
llmeade
 
Lect02 Introducing Programming.ppt
Lect02 Introducing Programming.pptLect02 Introducing Programming.ppt
Lect02 Introducing Programming.ppt
NourhanTarek23
 
Spf chapter 03 WinForm
Spf chapter 03 WinFormSpf chapter 03 WinForm
Spf chapter 03 WinForm
Hock Leng PUAH
 
SPF WinForm Programs
SPF WinForm ProgramsSPF WinForm Programs
SPF WinForm Programs
Hock Leng PUAH
 
LECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxLECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptx
AOmaAli
 
How support caller ID phone number
How support caller ID phone numberHow support caller ID phone number
How support caller ID phone number
topomax
 
Csc153 chapter 03
Csc153 chapter 03Csc153 chapter 03
Csc153 chapter 03
PCC
 
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxhjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
EliasPetros
 
Automatic dimmer package dimensioning RS-232
Automatic dimmer package dimensioning RS-232Automatic dimmer package dimensioning RS-232
Automatic dimmer package dimensioning RS-232
topomax
 
Visual basics Express Project
Visual basics Express ProjectVisual basics Express Project
Visual basics Express Project
Iftikhar Ahmed
 
Ppt lesson 03
Ppt lesson 03Ppt lesson 03
Ppt lesson 03
Linda Bodrie
 
Introduction
IntroductionIntroduction
How support caller Id phone number with a modem
How support caller Id phone number with a modemHow support caller Id phone number with a modem
How support caller Id phone number with a modem
topomax
 
Chapter 02 - Program and Grapahical User Interface
Chapter 02 - Program and Grapahical User InterfaceChapter 02 - Program and Grapahical User Interface
Chapter 02 - Program and Grapahical User Interface
patf719
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
llmeade
 
Vb tutorial
Vb tutorialVb tutorial
Vb tutorial
jayguyab
 
Digital Calipers Software Mitutoyo / Logiciel pour Pied à coulisse Mitutoyo (...
Digital Calipers Software Mitutoyo / Logiciel pour Pied à coulisse Mitutoyo (...Digital Calipers Software Mitutoyo / Logiciel pour Pied à coulisse Mitutoyo (...
Digital Calipers Software Mitutoyo / Logiciel pour Pied à coulisse Mitutoyo (...
topomax
 
You have been engaged to develop a special calculator program. T.docx
You have been engaged to develop a special calculator program. T.docxYou have been engaged to develop a special calculator program. T.docx
You have been engaged to develop a special calculator program. T.docx
briancrawford30935
 
A d swincc15e
A d swincc15eA d swincc15e
A d swincc15e
confidencial
 
COSC 1436 Project Page 1 Pre Project Example Secti.docx
COSC 1436 Project Page 1  Pre Project Example Secti.docxCOSC 1436 Project Page 1  Pre Project Example Secti.docx
COSC 1436 Project Page 1 Pre Project Example Secti.docx
faithxdunce63732
 

Similar to Chapter 03 - Program Coding and Design (20)

Chapter 03
Chapter 03Chapter 03
Chapter 03
 
Lect02 Introducing Programming.ppt
Lect02 Introducing Programming.pptLect02 Introducing Programming.ppt
Lect02 Introducing Programming.ppt
 
Spf chapter 03 WinForm
Spf chapter 03 WinFormSpf chapter 03 WinForm
Spf chapter 03 WinForm
 
SPF WinForm Programs
SPF WinForm ProgramsSPF WinForm Programs
SPF WinForm Programs
 
LECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxLECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptx
 
How support caller ID phone number
How support caller ID phone numberHow support caller ID phone number
How support caller ID phone number
 
Csc153 chapter 03
Csc153 chapter 03Csc153 chapter 03
Csc153 chapter 03
 
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxhjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
 
Automatic dimmer package dimensioning RS-232
Automatic dimmer package dimensioning RS-232Automatic dimmer package dimensioning RS-232
Automatic dimmer package dimensioning RS-232
 
Visual basics Express Project
Visual basics Express ProjectVisual basics Express Project
Visual basics Express Project
 
Ppt lesson 03
Ppt lesson 03Ppt lesson 03
Ppt lesson 03
 
Introduction
IntroductionIntroduction
Introduction
 
How support caller Id phone number with a modem
How support caller Id phone number with a modemHow support caller Id phone number with a modem
How support caller Id phone number with a modem
 
Chapter 02 - Program and Grapahical User Interface
Chapter 02 - Program and Grapahical User InterfaceChapter 02 - Program and Grapahical User Interface
Chapter 02 - Program and Grapahical User Interface
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 
Vb tutorial
Vb tutorialVb tutorial
Vb tutorial
 
Digital Calipers Software Mitutoyo / Logiciel pour Pied à coulisse Mitutoyo (...
Digital Calipers Software Mitutoyo / Logiciel pour Pied à coulisse Mitutoyo (...Digital Calipers Software Mitutoyo / Logiciel pour Pied à coulisse Mitutoyo (...
Digital Calipers Software Mitutoyo / Logiciel pour Pied à coulisse Mitutoyo (...
 
You have been engaged to develop a special calculator program. T.docx
You have been engaged to develop a special calculator program. T.docxYou have been engaged to develop a special calculator program. T.docx
You have been engaged to develop a special calculator program. T.docx
 
A d swincc15e
A d swincc15eA d swincc15e
A d swincc15e
 
COSC 1436 Project Page 1 Pre Project Example Secti.docx
COSC 1436 Project Page 1  Pre Project Example Secti.docxCOSC 1436 Project Page 1  Pre Project Example Secti.docx
COSC 1436 Project Page 1 Pre Project Example Secti.docx
 

Recently uploaded

OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 

Recently uploaded (20)

OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 

Chapter 03 - Program Coding and Design

  • 1. Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding
  • 2. 3 Objectives ►Change the BackColor property of an object ►Understand Visual Basic 2010 code statement formats ►Use IntelliSense to enter Visual Basic 2010 code statements ►Correct errors in Visual Basic 2010 code ►Write code for an object ►Print code ►Prepare an Event Planning Document Chapter 3: Program Design and Coding 2
  • 3. 3 BackColor Property ►Click the Windows Form object to select it ►If necessary, scroll in the Properties window until the BackColor property is displayed, and then click the right column of the BackColor property ►Click the BackColor arrow. Then, if necessary, click the Web tab to display the Web tabbed page ►Scroll to display the color you wish to apply ►Click the color you wish to apply on the color list Chapter 3: Program Design and Coding 3
  • 4. 3 BackColor Property Chapter 3: Program Design and Coding 4
  • 5. 3 Sizing an Image ►With the PictureBox object containing the StandardRoom image selected, scroll in the picStandardRoom Properties window until you see the SizeMode property. Click the SizeMode property name in the left column and then click the SizeMode arrow in the right column of the SizeMode property ►Click StretchImage in the SizeMode list Chapter 3: Program Design and Coding 5
  • 6. 3 Sizing an Image Chapter 3: Program Design and Coding 6
  • 7. 3 Running a Program ►Point to the Start Debugging button on the Standard toolbar ►Click the Start Debugging button on the Standard toolbar Chapter 3: Program Design and Coding 7
  • 8. 3 Entering Visual Basic Code for Event Handling ►With Visual Studio 2010 and the Hotel Room Selection program open and the frmHotelRoomSelection.vb [Design] tabbed window visible, point to the Standard Room Button object in the Windows Form object ►Double-click the Standard Room Button object Chapter 3: Program Design and Coding 8
  • 9. 3 Entering Visual Basic Code for Event Handling Chapter 3: Program Design and Coding 9
  • 10. 3 Visual Basic 2010 Coding Statements ►The Visual Basic syntax specifies how each statement must be written ►When the user clicks the Standard Room button while the program is running, the standard room image should be displayed in the picStandardRoom PictureBox object Chapter 3: Program Design and Coding 10
  • 11. 3 General Format of a Visual Basic Statement Chapter 3: Program Design and Coding 11
  • 12. 3 IntelliSense ►IntelliSense displays all allowable entries you can make in a Visual Basic statement each time a dot (period), equal sign, or other special character required for the statement is typed Chapter 3: Program Design and Coding 12
  • 13. 3 Entering a Visual Basic Statement ► With the code window open and the insertion point positioned as shown in Figure 3-25 on page 131, type pic followed by a period ► To identify the correct entry, type the first letters of the entry until the entry is selected. In this case, type s on your keyboard ► When IntelliSense highlights the correct object name, press the key on the keyboard corresponding to the entry that is to follow the object name. In this case, press the PERIOD key ► As with the object name in the second step, the next step is to enter one or more characters until IntelliSense highlights the desired property in the list. Type the letter, v on your keyboard Chapter 3: Program Design and Coding 13
  • 14. 3 Entering a Visual Basic Statement ►Press the key for the character that is to follow the property name. In this case, press the SPACEBAR on the keyboard ►Press the EQUAL SIGN key on the keyboard and then press the SPACEBAR. On the IntelliSense list, click the Common tab to display the most common results ►Type t on the keyboard ►Press the key for the character that is to follow the True entry. In this case, press the ENTER key Chapter 3: Program Design and Coding 14
  • 15. 3 Comments in Program Statements ►To insert a blank line following the event code generated by Visual Studio that begins with the word, Private, click anywhere in that line and then press the END key on your keyboard ►Press the ENTER key ►Type the first line of the comments, beginning with an apostrophe, as shown in Figure 3-46 on page 143, and then press the ENTER key Chapter 3: Program Design and Coding 15
  • 16. 3 Comments in Program Statements Chapter 3: Program Design and Coding 16
  • 17. 3 Same Line Comments Chapter 3: Program Design and Coding 17
  • 18. 3 Introductory Comments ►Click to the left of the word, Public, on line 1 in the program to place the insertion point on that line ►Press the ENTER key one time, and then press the UP ARROW key one time ►Type an apostrophe, a space, the text, Program Name: and then press the TAB key one time ►Type Hotel Room Selection as the name of the program. Then, press the ENTER key Chapter 3: Program Design and Coding 18
  • 19. 3 Introductory Comments Chapter 3: Program Design and Coding 19
  • 20. 3 Correcting Errors in Code ►Using IntelliSense reduces the likelihood of coding errors considerably, although it is still possible to code an error • One possible error may be forgetting an apostrophe in a comment statement ►A build errors message means the Visual Basic compiler detected a coding error in the program Chapter 3: Program Design and Coding 20
  • 21. 3 Correcting Errors in Code Chapter 3: Program Design and Coding 21
  • 22. 3 Correcting Errors in Code ►Click the No button in the Microsoft Visual Studio dialog box that informs you of a build error ►Double-click anywhere on the error line ►Click in the leftmost column on line 7 to place the insertion point at that location ►Type an apostrophe ►Click anywhere in the code editing window Chapter 3: Program Design and Coding 22
  • 23. 3 Correcting Errors in Code Chapter 3: Program Design and Coding 23
  • 24. 3 Additional Click Events ►On the frmHotelRoomSelection.vb [Design] tabbed page, double-click the Exit Window Button object Chapter 3: Program Design and Coding 24
  • 25. 3 Close Procedure ►With the insertion point positioned as shown in Figure 3-64 on page 154, type clo to highlight Close in the IntelliSense list ►Press the ENTER key Chapter 3: Program Design and Coding 25
  • 26. 3 Printing Code ►Click File on the menu bar to display the File menu ►Click Print on the File menu to display the Print dialog box ►Ensure that a check mark appears in the Include line numbers check box if you want line numbers on your printout. Most developers prefer line numbers on printouts ►Make any other selections you find necessary in the Print dialog box ►Click the OK button in the Print dialog box to print the code Chapter 3: Program Design and Coding 26
  • 27. 3 Event Planning Document Chapter 3: Program Design and Coding 27
  • 28. 3 Phase 4 – Code the Program ►After the events and tasks within the vents have been identified, the developer is ready to code the program • Entering Visual Basic statements to accomplish the tasks specified on the event planning document ►Developer enters the code and implements the logic Chapter 3: Program Design and Coding 28
  • 29. Microsoft Visual Basic 2010 CHAPTER THREE COMPLETE Program Design and Coding