Zak - Ch01 Theory
Zak - Ch01 Theory
Chapter 1
An Introduction
to Visual
Studio 2017
and 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
FOCUS ON THE CONCEPTS LESSON
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
F-1 Computer Programming Terminology
(1 of 2)
• In essence, the word programming means giving a
mechanism the directions to accomplish a task.
• A set of instructions that tells a computer how to
accomplish a task is called a computer program or,
more simply, a program.
• Programs are written by programmers using a variety
of special languages called programming languages.
• An integrated development environment (IDE) is an
environment that contains all of the tools and features
you need to create, run, and test your programs.
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
F-1 Computer Programming Terminology
(2 of 2)
• A graphical user interface (or GUI) is what the person
using your program (referred to as the user) sees and
interacts with while your program is running.
• Program instructions (code) is what we code to let the
program do a job.
• The user interface and its program instructions are referred
to as an application.
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
To run the Good Morning application:
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
F-2 The Programmer’s Job
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
F-3 The Visual Basic Programming
Language
• Visual Basic is an object-oriented programming
language, which is a language that allows the
programmer to use objects to accomplish a program’s
goal.
• In object-oriented programming, or OOP, an object is
anything that can be used.
• Every object in an object-oriented program is created
from a class, which is a pattern that the computer
uses to create the object.
• An object created from a class is called an instance of
the class.
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
F-4 Object vs Class
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
F-5 Object vs Class
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
To run the applications (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
To run the applications (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
To run the applications (3 of 3)
• Click the Hide equation button to hide the equation,
and then click the Exit button to close the application
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
F-4 The Visual Studio IDE (1 of 4)
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
F-4 The Visual Studio IDE (2 of 4)
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
F-4 The Visual Studio IDE (3 of 4)
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
F-5 Assigning Names to Objects (1 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
F-5 Assigning Names to Objects (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
Assignment Statements and Comments
(1 of 7)
• You can set an object’s properties during design time,
which is when you are building the interface.
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
Assignment Statements and Comments
(2 of 7)
• The operator indicates that the property is a member of
the object. (property belongs to object)
• The equal sign in an assignment statement is called the
assignment operator.
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
Assignment Statements and Comments
(3 of 7)
Create a UI:
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
Assignment Statements and Comments
(4 of 7)
• Code a comment before the class (program, author,
date)
• Code an event procedure for btnShow (a click event):
– btnView.Visible = True
– (This stores true in btnView’s visible property as soon as
the instruction is executed (run). If the button is visible, it
is displayed)
• Code an event procedure for btnHide (a click event):
– btnView.Visible = False
– (This stores false in btnView’s visible property as soon as
the instruction is executed (run). If the button is NOT
visible, it disappears)
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
Assignment Statements and Comments
(7 of 7)
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
Summary (1 of 3)
• Programs are the step-by-step instructions that tell a
computer how to perform a task.
• Programmers use various programming languages to
communicate with the computer.
• Programmers are responsible for translating a
problem’s solution into instructions that the computer
can understand.
• Programmers rigorously test a program before
releasing the program to the user.
• An object-oriented programming language, such as
Visual Basic, enables programmers to use objects
(e.g.,
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
Summary (2 of 3)
• check boxes and buttons) to accomplish a program’s goal.
An object is anything that can be used.
• Every object in an object-oriented program is instantiated
(created) from a class,
• A class is a pattern that tells the computer how the object
should look (data) and behave (do). An object is referred to
as an instance of the class.
• The four windows you use most often when designing
application’s GUI are:
– the designer Window,
– Toolbox Window,
– solution explorer Window,
– properties Window.
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part
Summary (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