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

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
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
 
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
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
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
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
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
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
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
 
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
 
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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 

Recently uploaded (20)

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
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
 
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
 
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
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
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
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
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
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
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
 
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
 
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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 

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