Microsoft Visual Basic 2017 For Windows
Microsoft Visual Basic 2017 For Windows
Chapter 1
Introduction to
Visual Basic
2017
Programming
• Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Objectives (1 of 3)
• Understand software and computer programs
• State the role of a developer in creating computer
programs
• Specify the use of a graphical user interface and
describe an event-driven program
• Specify the roles of input, processing, output, and data
when running a program on a computer
• Explain the logical operations a computer program can
perform
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Objectives (2 of 3)
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Objectives (3 of 3)
• Explain RAD
• Describe classes, objects, and the .NET Framework
class libraries
• Explain ADO.NET, ASP.NET, MSIL, and CLR
• Specify the types of Visual Basic 2017 applications
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Introduction (1 of 6)
• The set of instructions that directs a computer to
perform tasks is called computer software, or a
computer program
• A computer program on a mobile device or on a
Windows 10 computer is also called an app
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Introduction (2 of 6)
• Computer hardware is the physical equipment associated
with a computer
• A mobile device is portable computer hardware
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Introduction (3 of 6)
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Introduction (4 of 6)
• The computer’s central processing unit (CPU) can
access the program instructions and the data in RAM to
perform activities as directed by the program
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Introduction (5 of 6)
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Introduction (6 of 6)
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Computer Programmers and Developers
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Event-Driven Computer Programs
with a Graphical User Interface (1 of 2)
• Most Visual Basic 2017 programs are event-driven
programs that communicate with the user through a
graphical user interface (GUI)
– The GUI usually consists of a window, containing a
variety of objects
• An event means the user has initiated an action that
causes the program to perform a type of processing in
response to that action
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Event-Driven Computer Programs
with a Graphical User Interface (2 of 2)
• For example:
– A user might enter data into the program and then click a
button
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Input Operation
• A fundamental operation in most computer programs
involves a user who enters data
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Output Operation (1 of 3)
• The second basic program operation is creating
output, or information
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Output Operation (2 of 3)
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Output Operation (3 of 3)
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Basic Arithmetic Operations
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Logical Operations
• Computers, through the use of programs, can compare
numbers, letters of the alphabet, and special characters
• The program can perform one processing task if the
tested condition is true
• A program can perform the following logical operations:
– Comparing to determine if two values are equal
– Comparing to determine if one value is greater than
another value
– Comparing to determine if one value is less than another
value
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Saving Software and Data
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Visual Basic 2017 and Visual Studio 2017
(1 of 2)
• Each program statement causes the computer to
perform one or more operations
• The developer must follow the syntax, or
programming rules, of the programming language
precisely
• Most developers use a tool called Visual Studio 2017
to write Visual Basic 2017 programs
• Visual Studio 2017 is a type of integrated
development environment (IDE)
– Provides services and tools that enable a developer to
code, test, and implement a single program or
sometimes a series of programs
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Visual Basic 2017 and Visual Studio 2017
(2 of 2)
• Coded statements in the Visual Basic 2017
programming language:
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Microsoft Imagine
• Microsoft program that supports technical education by
providing access to Microsoft software for learning,
teaching, and research purposes such as Visual
Studio
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Visual Studio 2017 Window (1 of 3)
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Visual Studio 2017 Window (2 of 3)
• The following elements help you to use the Visual
Studio 2017 Window:
• Title bar: The title bar identifies the window and the
application open in the window
• Menu bar: The menus contain lists of commands that
allow you to create, edit, save, print, test, and run a
Visual Basic program and to perform other functions
• Standard tool bar: The Standard tool bar contains
buttons that execute frequently used commands such
as
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Visual Studio 2017 Window (3 of 3)
Open Project, New Project, Save, Cut, Copy, Paste, and
Undo
• Toolbox: The toolbox contains .NET components
that help you develop the GUI program
• Main work area: The main work area contains the item
you are currently developing
• Solution Explorer: The Solution Explorer window
displays the elements of the Visual Basic solution
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Programming Languages (1 of 2)
• Visual Basic
– Programming language that allows developers to easily
build complex Windows and web programs, as well as
other software tools
– Based on the BASIC language
• Visual C++
– Derivative of the programming language C
• Visual C#
– synthesis of the elegance and syntax of C++ with many
of the productivity benefits enjoyed in Visual Basic
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Programming Languages (2 of 2)
• JavaScript
– Open-source client-side scripting language
• Visual F#
– Multipurpose language known for its math-intensive
focus
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
.NET Framework 4.6.2
• .NET technologies and products were designed to work
together to allow businesses to connect information,
people, systems, and devices through software
• The .NET Framework provides tools and processes
that developers can use to produce and run programs
– Most recent version is .NET Framework 4.6.2
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
.NET Class Library (1 of 2)
• A class is a named group of program code
– A button is an example of a class
• A class library stores the class and makes the
class available to all developers who need to use it
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
.NET Class Library (2 of 2)
• A button created from a class is called an object, or
sometimes an instance of a class
• The process of creating a Button object from the Button
class is called instantiation
• Rapid application development (RAD) refers to the
process of using prebuilt classes to make application
development faster, easier, and more reliable
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
ADO.NET
• ADO.NET (ActiveX Data Objects) provides the
functionality for a program to perform four primary tasks
when working with a database:
– Getting the data
– Examining the data
– Editing the data
– Updating the data
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
ASP.NET
• Allows developers to use Visual Studio 2017 to build
powerful and sophisticated web applications
• Using ASP.NET classes, programmers can create
websites that perform any function available on web
• ASP.NET is designed for cloud technologies and
server-side applications
• Cloud computing is the connection of remote servers
hosted on the Internet to store and process data,
instead of storing the information locally on a personal
computer or device
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Microsoft Intermediate Language and
Common Language Runtime (1 of 2)
• Program compilation translates programming
statements into instructions that can be understood by
the electronics of the computer
• Program compilation for a Visual Basic 2017 program
creates a set of electronic code expressed in an
intermediate language called the Microsoft
Intermediate Language (MSIL)
• When the program is executed, a portion of .NET called
the Common Language Runtime (CLR) reads the
MSIL and causes the instructions within the program to
be executed
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Microsoft Intermediate Language and
Common Language Runtime (2 of 2)
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Types of Visual Basic 2017 Applications
• Windows Classic Desktop application
– Program will run on a computer or other device that
supports the Windows GUI
• Windows Universal apps
– Designed to run on Windows 8 or Windows 10
computers and mobile devices
• Web application
– Uses ASP.NET and runs on a web server
• Database application
– Written using ADO.NET to reference, access, display,
and update data stored in a database
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Microsoft HoloLens Development (1 of 3)
• HoloLens is the augmented reality headset that places
3-D holographic images in your scope of vision
• HoloLens apps are being developed using Visual
Studio:
– To select car options at Volvo dealerships
– To create a custom kitchen at Lowe’s Home Centers
– To explore other planets at NASA
– To replace a flat-screen TV with a much larger
holographic display
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Microsoft HoloLens Development (2 of 3)
• Microsoft Visual Studio works with Unity software to
build HoloLens apps and test them on a built-in
HoloLens emulator
• The emulator uses a Hyper-V virtual machine to run the
app
• HoloLens are stimulated using your keyboard, mouse,
or Xbox controller
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Microsoft HoloLens Development (3 of 3)
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
Summary
• understand the fundamentals of computer
programming and have been introduced to the Visual
Studio 2017 and Visual Basic 2017 program
development environments
• In subsequent chapters, you will learn to use Virtual
Studio 2017 and Visual Basic 2017 to create Windows
Classic Desktop applications for Windows Universal
apps, database applications, Web/Cloud applications
for computer and mobile devices, and HoloLens apps
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.