SlideShare a Scribd company logo
1 of 37
Hello!
I am Ma. Wennilou Porazo
Instructor
1
An
Introduction
to Visual
Basic
After studying Lesson B, you should
be able to:
● Add a VB control to a form
● Set the properties of a label, picture box, and button
control
● Select multiple controls on the form
● Format multiple VB controls simultaneously
● Open the Project Designer window
3
(cont.)
● Start and end an application
● Enter code in the Code Editor window
● Terminate an application using the Me.Close()
instruction
● Run the project’s executable file
4
Toolbox Window
● Class
○ A pattern form which an object is created
● Object
○ An instance of a class with particular setting
behaviors and attributes
5
● Toolbox Window or toolbox
○ Contains component tools for designing a
user in
○ Each tool represents a clas
○ VB Controls are instantiated using tools
6
● VB Controls
● -VB GUI objects that appear on a form.
7
8
The Label Tool
● Used to create a label control
○ Displays text that cannot be edited at run
time
● Important Properties
● Name Property
○ A unique name for control
9
Continuation……….
● Text Property
○ Specifies the value that appears in a label
control
● Location Property
○ Specifies the location of a control on a form
○ Includes an X value and a Y value
10
11
Changing a Property For Multiple
Controls
● A control inherits the font attribute of the
form.
○ You may want to change the default values
12
(cont.)
● To simultaneously modify similar controls:
○ Click one control and then press and hold
the Ctrl key
○ Click other similar control(s) in the form, or
click and drag to group the controls
○ Set the property value in the Properties list
13
14
Picture Box Tool
Button Tool
● Used to create a button control
○ Used to perform an action when clicked
○ Examples: OK and Cancel buttons
● Common means of exiting a Windows application:
○ Exit option on the FILE menu
○ Exit button
15
Starting and Ending an Application
● Startup form
○ Displays when an application is first started
● The Project Designer window specifies the
startup form or the executable code to be run
○ Right-click My Project in the Solution
Explorer window and then click Open
16
Continuation
○ Or, click PROJECT on the menu bar and
then click <project name> Properties
● Application tab
○ Specify startup form
17
Starting and Ending Application
18
Starting and Ending Application
● Executable file
● A file that can be run outside of the IDE
● Its filename ends with .exe
● It is automatically created when a Visual Basic
application is started.
19
Starting and Ending Application (cont.)
● Two ways to start an application in the IDE:
○ Click DEBUG on the menu bar and then click
Start Debugging
○ Press F5 key
20
Code Editor Window
● Events
○ User actions such as click, right-click, mouse-
over,
● Event procedure
○ A set of program instructions that are
processed when an event occurs
21
Code Editor Window (cont.)
● Code Editor window
○ Provides templates for creating event
procedures
○ To open it, right-click the form and then click
View Code
22
23
Code Editor window opened in the IDE
Code Editor Window (cont.)
● Class Name list box
○ Lists names of objects (VB controls) included
in the user interface.
● Method Name list box
○ Lists appropriate events for the selected
object
24
Code Editor Window (cont.)
● To select a VB control’s event in the Code Editor
window
○ Select the class name first
○ Then select the method name
● Syntax
○ The rules of a programming language
25
26
Code collapsed in the Code Editor Window
Writing a Procedure
● Procedure header
○ The first line in the code template for an
event procedure
● Procedure footer
○ The last line in the code template for an event
procedure
27
Writing a Procedure
● Keyword
○ A word that has a special meaning in a programming
language
○ Color coded in the IDE
28
29
Event Sub Procedure
● Sub procedure
A block of code that performs a specific task
● Keywords in a sub procedure block:
○ Sub: Starts a sub procedure
○ End Sub: Indicates the end of a sub procedure
○ Private: Restricts the use of the procedure to the
form where it appears.
30
Event Sub Procedure
• The names of event sub procedure include the
object (VB control) name and event name
Example: btnExit_Click
31
Me. Close () Instruction and IntelliSense
● Method
○ A predefined procedure
○ Can be called or invoked when needed
● Me.Close() method
○ Causes the current form to close
○ If it is only form in an application, the application
terminates
32
Me. Close () Instruction and IntelliSense
● Intellisense feature
○ Provides appropriate selections as pop-up lists
when coding
○ Type the first few letters of your choice
○ Then use the arrow keys to select an item in the
list
33
34
List displayed by the IntelliSense feature
Lesson B, Summary
● To add a control to a form, use a tool from the
toolbox
● Use the label control for text that users cannot
edit
● You can set the properties of multiple controls
simultaneously
35
Lesson B, Summary (cont.)
● To start and stop an application in the IDE, use
DEBUG on the menu bar
● Use the Code Editor window to display an
object’s event procedures
● The Me.Close() method closes the current form
at run time
36
Thanks!
37

More Related Content

Similar to CHAPTER 1: Lesson B

Similar to CHAPTER 1: Lesson B (20)

vb.pptx
vb.pptxvb.pptx
vb.pptx
 
vb-160518151614.pdf
vb-160518151614.pdfvb-160518151614.pdf
vb-160518151614.pdf
 
vb-160518151614.pptx
vb-160518151614.pptxvb-160518151614.pptx
vb-160518151614.pptx
 
CHAPTER 3 - LESSON C
CHAPTER 3 - LESSON CCHAPTER 3 - LESSON C
CHAPTER 3 - LESSON C
 
Visual basic
Visual basicVisual basic
Visual basic
 
Introduction to Visual Basic (Week 2)
Introduction to Visual Basic (Week 2)Introduction to Visual Basic (Week 2)
Introduction to Visual Basic (Week 2)
 
Intake 37 9
Intake 37 9Intake 37 9
Intake 37 9
 
Spf chapter 03 WinForm
Spf chapter 03 WinFormSpf chapter 03 WinForm
Spf chapter 03 WinForm
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
 
Intake 38 9
Intake 38 9Intake 38 9
Intake 38 9
 
Chapter 03 - Program Coding and Design
Chapter 03 - Program Coding and DesignChapter 03 - Program Coding and Design
Chapter 03 - Program Coding and Design
 
Chapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface DesignChapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface Design
 
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
 
SPF WinForm Programs
SPF WinForm ProgramsSPF WinForm Programs
SPF WinForm Programs
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptx
 
W1.pptx
W1.pptxW1.pptx
W1.pptx
 
Chapter 2: LESSON A
Chapter 2: LESSON AChapter 2: LESSON A
Chapter 2: LESSON A
 
Introduction
IntroductionIntroduction
Introduction
 
Vb.net ide
Vb.net ideVb.net ide
Vb.net ide
 
VB.NET programming
VB.NET programmingVB.NET programming
VB.NET programming
 

More from MLG College of Learning, Inc (20)

PC111.Lesson2
PC111.Lesson2PC111.Lesson2
PC111.Lesson2
 
PC111.Lesson1
PC111.Lesson1PC111.Lesson1
PC111.Lesson1
 
PC111-lesson1.pptx
PC111-lesson1.pptxPC111-lesson1.pptx
PC111-lesson1.pptx
 
PC LEESOON 6.pptx
PC LEESOON 6.pptxPC LEESOON 6.pptx
PC LEESOON 6.pptx
 
PC 106 PPT-09.pptx
PC 106 PPT-09.pptxPC 106 PPT-09.pptx
PC 106 PPT-09.pptx
 
PC 106 PPT-07
PC 106 PPT-07PC 106 PPT-07
PC 106 PPT-07
 
PC 106 PPT-01
PC 106 PPT-01PC 106 PPT-01
PC 106 PPT-01
 
PC 106 PPT-06
PC 106 PPT-06PC 106 PPT-06
PC 106 PPT-06
 
PC 106 PPT-05
PC 106 PPT-05PC 106 PPT-05
PC 106 PPT-05
 
PC 106 Slide 04
PC 106 Slide 04PC 106 Slide 04
PC 106 Slide 04
 
PC 106 Slide no.02
PC 106 Slide no.02PC 106 Slide no.02
PC 106 Slide no.02
 
pc-106-slide-3
pc-106-slide-3pc-106-slide-3
pc-106-slide-3
 
PC 106 Slide 2
PC 106 Slide 2PC 106 Slide 2
PC 106 Slide 2
 
PC 106 Slide 1.pptx
PC 106 Slide 1.pptxPC 106 Slide 1.pptx
PC 106 Slide 1.pptx
 
Db2 characteristics of db ms
Db2 characteristics of db msDb2 characteristics of db ms
Db2 characteristics of db ms
 
Db1 introduction
Db1 introductionDb1 introduction
Db1 introduction
 
Lesson 3.2
Lesson 3.2Lesson 3.2
Lesson 3.2
 
Lesson 3.1
Lesson 3.1Lesson 3.1
Lesson 3.1
 
Lesson 1.6
Lesson 1.6Lesson 1.6
Lesson 1.6
 
Lesson 3.2
Lesson 3.2Lesson 3.2
Lesson 3.2
 

Recently uploaded

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 

Recently uploaded (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

CHAPTER 1: Lesson B

  • 1. Hello! I am Ma. Wennilou Porazo Instructor 1
  • 3. After studying Lesson B, you should be able to: ● Add a VB control to a form ● Set the properties of a label, picture box, and button control ● Select multiple controls on the form ● Format multiple VB controls simultaneously ● Open the Project Designer window 3
  • 4. (cont.) ● Start and end an application ● Enter code in the Code Editor window ● Terminate an application using the Me.Close() instruction ● Run the project’s executable file 4
  • 5. Toolbox Window ● Class ○ A pattern form which an object is created ● Object ○ An instance of a class with particular setting behaviors and attributes 5
  • 6. ● Toolbox Window or toolbox ○ Contains component tools for designing a user in ○ Each tool represents a clas ○ VB Controls are instantiated using tools 6
  • 7. ● VB Controls ● -VB GUI objects that appear on a form. 7
  • 8. 8
  • 9. The Label Tool ● Used to create a label control ○ Displays text that cannot be edited at run time ● Important Properties ● Name Property ○ A unique name for control 9
  • 10. Continuation………. ● Text Property ○ Specifies the value that appears in a label control ● Location Property ○ Specifies the location of a control on a form ○ Includes an X value and a Y value 10
  • 11. 11
  • 12. Changing a Property For Multiple Controls ● A control inherits the font attribute of the form. ○ You may want to change the default values 12
  • 13. (cont.) ● To simultaneously modify similar controls: ○ Click one control and then press and hold the Ctrl key ○ Click other similar control(s) in the form, or click and drag to group the controls ○ Set the property value in the Properties list 13
  • 15. Button Tool ● Used to create a button control ○ Used to perform an action when clicked ○ Examples: OK and Cancel buttons ● Common means of exiting a Windows application: ○ Exit option on the FILE menu ○ Exit button 15
  • 16. Starting and Ending an Application ● Startup form ○ Displays when an application is first started ● The Project Designer window specifies the startup form or the executable code to be run ○ Right-click My Project in the Solution Explorer window and then click Open 16
  • 17. Continuation ○ Or, click PROJECT on the menu bar and then click <project name> Properties ● Application tab ○ Specify startup form 17
  • 18. Starting and Ending Application 18
  • 19. Starting and Ending Application ● Executable file ● A file that can be run outside of the IDE ● Its filename ends with .exe ● It is automatically created when a Visual Basic application is started. 19
  • 20. Starting and Ending Application (cont.) ● Two ways to start an application in the IDE: ○ Click DEBUG on the menu bar and then click Start Debugging ○ Press F5 key 20
  • 21. Code Editor Window ● Events ○ User actions such as click, right-click, mouse- over, ● Event procedure ○ A set of program instructions that are processed when an event occurs 21
  • 22. Code Editor Window (cont.) ● Code Editor window ○ Provides templates for creating event procedures ○ To open it, right-click the form and then click View Code 22
  • 23. 23 Code Editor window opened in the IDE
  • 24. Code Editor Window (cont.) ● Class Name list box ○ Lists names of objects (VB controls) included in the user interface. ● Method Name list box ○ Lists appropriate events for the selected object 24
  • 25. Code Editor Window (cont.) ● To select a VB control’s event in the Code Editor window ○ Select the class name first ○ Then select the method name ● Syntax ○ The rules of a programming language 25
  • 26. 26 Code collapsed in the Code Editor Window
  • 27. Writing a Procedure ● Procedure header ○ The first line in the code template for an event procedure ● Procedure footer ○ The last line in the code template for an event procedure 27
  • 28. Writing a Procedure ● Keyword ○ A word that has a special meaning in a programming language ○ Color coded in the IDE 28
  • 29. 29
  • 30. Event Sub Procedure ● Sub procedure A block of code that performs a specific task ● Keywords in a sub procedure block: ○ Sub: Starts a sub procedure ○ End Sub: Indicates the end of a sub procedure ○ Private: Restricts the use of the procedure to the form where it appears. 30
  • 31. Event Sub Procedure • The names of event sub procedure include the object (VB control) name and event name Example: btnExit_Click 31
  • 32. Me. Close () Instruction and IntelliSense ● Method ○ A predefined procedure ○ Can be called or invoked when needed ● Me.Close() method ○ Causes the current form to close ○ If it is only form in an application, the application terminates 32
  • 33. Me. Close () Instruction and IntelliSense ● Intellisense feature ○ Provides appropriate selections as pop-up lists when coding ○ Type the first few letters of your choice ○ Then use the arrow keys to select an item in the list 33
  • 34. 34 List displayed by the IntelliSense feature
  • 35. Lesson B, Summary ● To add a control to a form, use a tool from the toolbox ● Use the label control for text that users cannot edit ● You can set the properties of multiple controls simultaneously 35
  • 36. Lesson B, Summary (cont.) ● To start and stop an application in the IDE, use DEBUG on the menu bar ● Use the Code Editor window to display an object’s event procedures ● The Me.Close() method closes the current form at run time 36