0% found this document useful (0 votes)
354 views

CHAPTER 6 VB Lesson Notes

This document provides an overview of Visual Basic programming, including its history, features, and the programming process. Visual Basic is a popular programming language developed by Microsoft that incorporates an integrated development environment (IDE) to make it easy for programmers to create applications. The programming process in Visual Basic involves planning the user interface, setting object properties, writing code using structured programming techniques like sequences, selections, and loops, and following naming conventions. Pseudocode and flowcharts can help design the solution before writing the actual program code in the Visual Basic IDE.

Uploaded by

Luke Labakara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
354 views

CHAPTER 6 VB Lesson Notes

This document provides an overview of Visual Basic programming, including its history, features, and the programming process. Visual Basic is a popular programming language developed by Microsoft that incorporates an integrated development environment (IDE) to make it easy for programmers to create applications. The programming process in Visual Basic involves planning the user interface, setting object properties, writing code using structured programming techniques like sequences, selections, and loops, and following naming conventions. Pseudocode and flowcharts can help design the solution before writing the actual program code in the Visual Basic IDE.

Uploaded by

Luke Labakara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

CHAPTER 6

PROGRAMMING USING VISUAL BASIC


INTRODUCTION
What is programming?
• Programming (also known as Software Development) is a six step
procedure for creating a list of instructions for the computer to
follow.

Who is a programmer?
• A person who writes computer programs.
Bill Gates is arguably one of the most popular computer
programmers of all time.
HISTORY ABOUT VISUAL BASIC
Visual Basic (VB) is a computer programming language that
was developed by Microsoft.
It was first introduced in 1991 and was largely based on an
earlier programming language called BASIC.
VB is designed to be easy to use by incorporating an integrated
development environment (IDE)
IDE provides the programmer the tools for software
developments.
WHY VISUAL BASIC IS WIDELY USED:
• Modern and general purpose.
• Object oriented.
• Component oriented.
• Easy to learn.
• Structured language.
• It produces efficient programs.
• It can be compiled on a variety of computer platforms.
• Part of .NET Framework.
THE SIX STEPS OF SOFTWARE
DEVELOPMENT
1. Specification
2. Program Design Specification

3. Program Code Program


Design

4. Program Test
5. Program Documentation
6. Program Maintenance
VISUAL BASIC INTEGRATED DEVELOPMENT ENVIRONMENT
• Visual Basic is event-driven, meaning code remains idle until called
upon to respond to some event. Example by pressing a button.

• Visual Basic is governed by an event processor. Nothing happens


until an event is detected.

• A Visual Basic Application is called a solution, which can consist of


one or more projects. Each project can contain one or more files
APPLICATION PROJECT IS MADE UP OF THE
FOLLOWING
• Forms- Windows that you create for user interface.
• Controls - Graphical features drawn on forms to allow user interactions (text boxes,
labels, command buttons, etc.) Forms and controls are objects.
• Properties -Every characteristic of a form or control is specified by a property. Example
properties include names, captions, size, colour etc.
• Methods - Built-in procedure that can be invoked to impart some action to a particular
object.
• Event Procedures - Code related to some object. This is the code that is executed
when a certain event occurs.
• General Procedures - Code not related to objects. This code must be invoked by the
application.
• Modules - Collection of general procedures, variable declarations, and constant
definitions used by application.
VISUAL BASIC FILE TYPES
.sln a solution file that holds information about the project. This is the only file that
is opened

.suo a solution user options file that stores information about the selected options

.vb - a vb file that holds the definition of a form

.resx a resource file for the form

.vbproj a project file that describes the project and lists the files included

.vbproj.user project user option file that holds project option settings
ACTIVITY 1
1. Why is Visual Basic such a popular programming language?
2. What are some of the standard elements that can be placed on a
Windows Form?
3. What are objects and properties? How are they related to each
other?
4. What is the purpose of these Visual Basic file types: .sln and .vb?
5. Visual Basic is event-driven. What does this mean?
6. What is the purpose of an IDE?
Writing a Good Visual Basic Applications

A good programmer has to ensure the following:


1. Have good design of the user interface
2. Define the properties for the elements on the interface
3. Design the solution for the problem (algorithm).
1. Design the user interface-When planning the user interface, one
has to draw a sketch of the screens the user will see when the
project is running

2. Plan the properties- For each object, write down the properties
that you plan to set or change during the design of the form.

3. Plan the Solution - During this planning stage, you will write out the
actions using pseudocode, which is an English expression. Some
people prefer describing the steps using a flowchart.
OBJECT NAMING CONVENTIONS

After completing the planning steps and obtaining approval from the
users, the programmer can begin with the actual construction of the
project. In the actual program implementation, the programmer does
the following:

1. Defines the user interface and objects using the IDE.


2. Set the properties for the controls
3. Write the actual Basic code
SETTING THE PREFIXES
OBJECT NAMING RULES
When you select a name for an object, Visual Basic requires the name
to begin with a letter or an underscore.

The name can contain letters, digits, and underscores.

An object name cannot include a space or punctuation mark and


cannot be a reserved word, such as Button or Close or End or Print
etc. For example, btnExit, btnEnd and btnClose are legal.
FLOW CHART
• A flowchart is a diagrammatic representation of a program or a
graphic representation of the steps needed to solve the programming
problem.
Three arrangements are used in
programming to write structured
programs.
1. Sequence Structure - In the sequence structure one program
statement follows another.

2. Selection structure - The selection structure represents a choice. It


occurs when a choice must be made.

3. Loop - The loop/iteration structure describes a process that may be


repeated as long as a certain condition remains true
THREE PROGRAMMING STRUCTURES
PSEUDOCODE WRITING
• Another technique called pseudo code (pronounced ―soo-doo-
code‖) is rapidly increasing in popularity.

• Pseudocode allows a programmer to use English like sentences to


write an explanations of what the program is supposed to do.
Steps to creating the Visual Basic Program

You might also like