microsoft visual basic 2005 reloaded second edition n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Microsoft Visual Basic 2005: Reloaded Second Edition PowerPoint Presentation
Download Presentation
Microsoft Visual Basic 2005: Reloaded Second Edition

Loading in 2 Seconds...

play fullscreen
1 / 79

Microsoft Visual Basic 2005: Reloaded Second Edition - PowerPoint PPT Presentation


  • 112 Views
  • Uploaded on

Microsoft Visual Basic 2005: Reloaded Second Edition. Chapter 1 An Introduction to Visual Basic 2005. Objectives. After studying this chapter, you should be able to: Explain the history of programming languages Define the terminology used in object-oriented programming

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Microsoft Visual Basic 2005: Reloaded Second Edition' - sara-monroe


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
microsoft visual basic 2005 reloaded second edition

Microsoft Visual Basic 2005: Reloaded Second Edition

Chapter 1

An Introduction to Visual Basic 2005

objectives
Objectives

After studying this chapter, you should be able to:

  • Explain the history of programming languages
  • Define the terminology used in object-oriented programming
  • Explain the role of the .NET Framework class library and Common Language Runtime (CLR)
  • Create a Visual Basic 2005 Windows-based application
  • Manage the windows in the Integrated Development Environment (IDE)

Microsoft Visual Basic 2005: Reloaded, Second Edition

objectives continued
Objectives (continued)
  • Set the properties of an object
  • Add a control to a form
  • Use the Label, Button and PictureBox tools
  • Enter code in the Code Editor window
  • Save a solution

Microsoft Visual Basic 2005: Reloaded, Second Edition

objectives continued1
Objectives (continued)
  • Start and end an application
  • Print a project’s code
  • Write an assignment statement
  • Close and open an existing solution

Microsoft Visual Basic 2005: Reloaded, Second Edition

programmers
Programmers
  • Programs: instructions given to computers
  • Programmers: people who write programs
  • Applications programmers: write and maintain programs to handle specific tasks
  • Systems programmers: write and maintain programs that run the system, such as operating systems, device drivers, utilities

Microsoft Visual Basic 2005: Reloaded, Second Edition

a brief history of programming languages
A Brief History of Programming Languages
  • Programming languages: used to communicate with the computer
  • Machine language (or machine code):
    • Instructions are written in 0s and 1s
    • Only way to communicate directly with the computer
  • Assembly languages: use mnemonics for instructions
  • Mnemonics: alphabetic abbreviations for instructions

Microsoft Visual Basic 2005: Reloaded, Second Edition

a brief history of programming languages continued
A Brief History of Programming Languages (continued)
  • Assembler: program that converts assembly language instructions into machine code
  • High-level languages:
    • Instructions resemble English language
    • Require an interpreter or compiler to convert high-level language to machine code
  • Interpreter: translates high-level instructions line-by-line as the program runs
  • Compiler: translates entire program into machine code before running the program

Microsoft Visual Basic 2005: Reloaded, Second Edition

a brief history of programming languages continued1
A Brief History of Programming Languages (continued)
  • Procedure-oriented program: one that focuses on individual tasks and their sequence
  • Object-oriented program: one that focuses on objects the program can use to accomplish its goal

Microsoft Visual Basic 2005: Reloaded, Second Edition

oop terminology
OOP Terminology
  • OOP: Object-oriented programming
  • OOD: Object-oriented design
  • Object:
    • Represents a real-world entity
    • Attributes (or properties): describe the object
    • Methods: behaviors or operations the object can perform
  • Class: blueprint used to create an object

Microsoft Visual Basic 2005: Reloaded, Second Edition

oop terminology continued
OOP Terminology (continued)
  • Encapsulation: the class contains all the attributes and behaviors of the object created from the class
  • Instance: an object created from a class
  • Abstraction: the hiding of internal details of an object
  • Exposed: attributes and behaviors that are not hidden
  • Inheritance: ability to create one class from another

Microsoft Visual Basic 2005: Reloaded, Second Edition

oop terminology continued1
OOP Terminology (continued)
  • Derived class: a new class created from another by inheritance
  • Base class: the class used to create the new class
  • Polymorphism: allows the same instructions to be carried out differently depending on the object

Microsoft Visual Basic 2005: Reloaded, Second Edition

oop terminology continued2
OOP Terminology (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

visual studio 2005
Visual Studio 2005
  • Integrated Development Environment (IDE):
    • Contains all the tools and features needed to create, run, and test programs
    • Includes an editor and compiler
  • Visual Studio 2005:
    • IDE used to create Windows or Web-based programs
    • Includes Visual Basic 2005, Visual C++ 2005, Visual C# 2005, and Visual J# 2005

Microsoft Visual Basic 2005: Reloaded, Second Edition

visual studio 2005 continued
Visual Studio 2005 (continued)
  • Application: program or suite of programs
  • Windows-based application:
    • Has a Windows user interface
    • Runs on a desktop computer
  • User interface: what the user sees and interacts with when using an application

Microsoft Visual Basic 2005: Reloaded, Second Edition

visual studio 2005 continued1
Visual Studio 2005 (continued)
  • Web-based application:
    • Has a Web user interface
    • Runs on a server
    • Use a computer browser to access it
  • Microsoft .NET Framework 2.0: a platform on which you create applications
  • .NET languages: the programming languages included in Visual Studio
  • .NET applications: applications created with Visual Studio

Microsoft Visual Basic 2005: Reloaded, Second Edition

visual studio 2005 continued2
Visual Studio 2005 (continued)
  • .NET Framework class library:
    • Contains an extensive set of classes for use in .NET applications
    • Reduces development time by providing reusable code
    • Provides consistency among applications

Microsoft Visual Basic 2005: Reloaded, Second Edition

the common language runtime
The Common Language Runtime
  • .NET language compilers translate program statements into a Microsoft Intermediate Language, also called Intermediate Language (IL)
  • Common Language Runtime (CLR):
    • Manages the execution of IL instructions
  • Just-in-time (JIT) compiler: translates IL into machine code
  • CLR allows compiled IL to be reused, regardless of which .NET language was used to create it

Microsoft Visual Basic 2005: Reloaded, Second Edition

the common language runtime continued
The Common Language Runtime (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

solutions projects and files
Solutions, Projects, and Files
  • Solution: a container that stores projects and files for an entire application
  • Project: a container that stores files associated with a specific part of the solution

Microsoft Visual Basic 2005: Reloaded, Second Edition

solutions projects and files continued
Solutions, Projects, and Files (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

starting microsoft visual studio 2005
Starting Microsoft Visual Studio 2005

Microsoft Visual Basic 2005: Reloaded, Second Edition

starting microsoft visual studio 2005 continued
Starting Microsoft Visual Studio 2005 (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

starting microsoft visual studio 2005 continued1
Starting Microsoft Visual Studio 2005 (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

creating a visual basic 2005 windows based application
Creating a Visual Basic 2005 Windows-Based Application

Microsoft Visual Basic 2005: Reloaded, Second Edition

creating a visual basic 2005 windows based application continued
Creating a Visual Basic 2005 Windows-Based Application (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

creating a visual basic 2005 windows based application continued1
Creating a Visual Basic 2005 Windows-Based Application (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

managing the windows in the ide
Managing the Windows in the IDE

Microsoft Visual Basic 2005: Reloaded, Second Edition

the windows form designer window
The Windows Form Designer Window
  • Windows Form Designer window:
    • Allows you to create (design) the GUI
  • Graphical User Interface (GUI): what the user sees and interacts with when using the application
  • Windows Form object (or form):
    • Adds other objects such as buttons and textboxes to create the GUI
    • Instance of the Windows Form class
    • Automatically instantiated when you create an application

Microsoft Visual Basic 2005: Reloaded, Second Edition

the windows form designer window continued
The Windows Form Designer Window (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the solution explorer window
The Solution Explorer Window
  • Solution Explorer window:
    • Displays a list of projects contained in this solution
    • Displays the items contained in each project

Microsoft Visual Basic 2005: Reloaded, Second Edition

the solution explorer window continued
The Solution Explorer Window (continued)
  • Project Designer window:
    • Open by right-clicking on project folder
    • Allows you to set options for the project
    • Contains 9 tabs with groups of options

Microsoft Visual Basic 2005: Reloaded, Second Edition

the solution explorer window continued1
The Solution Explorer Window (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

slide33

The Solution Explorer Window (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the solution explorer window continued2
The Solution Explorer Window (continued)
  • Source file: a file containing program instructions
  • Code: program instructions
  • Form file: a file containing code associated with a Windows form object

Microsoft Visual Basic 2005: Reloaded, Second Edition

slide35

The Properties Window

  • Properties window: displays properties of selected object
  • Default property values are assigned when an object is created

Microsoft Visual Basic 2005: Reloaded, Second Edition

slide36

The Properties Window (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the properties window continued
The Properties Window (continued)
  • Properties window includes an Object box and a Properties list
  • Object box:
    • Located immediately below Properties window title bar
    • Contains the name of the selected object
  • Properties list:
    • Left column displays names of properties
    • Settings box: Right column containing the current value of each property

Microsoft Visual Basic 2005: Reloaded, Second Edition

properties of a windows form object
Properties of a Windows Form Object

Microsoft Visual Basic 2005: Reloaded, Second Edition

properties of a windows form object continued
Properties of a Windows Form Object (continued)
  • Class definition: block of code that defines the attributes and behaviors of an object
  • Namespace: defines a group of related classes
  • Dot member access operator: the period that separates words in an object’s name
  • Name property: used to refer to an object in code
  • Hungarian notation: naming convention using a 3 or more character prefix to represent the object type
  • Camel casing: lowercase prefix, uppercase first letter of each word

Microsoft Visual Basic 2005: Reloaded, Second Edition

properties of a windows form object continued1
Properties of a Windows Form Object (continued)
  • Pascal case:
    • First letter and first letter of each word is uppercase
    • First part of name is object’s purpose
    • Second part of name is object’s class
  • Textproperty: controls the caption displayed on form’s title bar
  • StartPositionproperty: determines the form’s position on the screen when application starts
  • Splash screen: first image to appear when application starts

Microsoft Visual Basic 2005: Reloaded, Second Edition

properties of a windows form object continued2
Properties of a Windows Form Object (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the toolbox window
The Toolbox Window
  • Toolbox:
    • Contains tools used to create an application
    • Each tool represents a class from which to instantiate objects
  • Controls:
    • Objects displayed on a form
    • Are represented as icons in the toolbox
    • Can be locked in place on the form
    • Control names use camel casing

Microsoft Visual Basic 2005: Reloaded, Second Edition

the toolbox window continued
The Toolbox Window (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the toolbox window continued1
The Toolbox Window (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the label tool
The Label Tool
  • Label tool: represents a label control
  • Label control:
    • Displays text that user cannot edit
    • Used as “prompts” to explain controls or display output

Microsoft Visual Basic 2005: Reloaded, Second Edition

the label tool continued
The Label Tool (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the label tool continued1
The Label Tool (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the button tool
The Button Tool
  • Button tool: represents a button control
  • Button control:
    • Performs an immediate action when clicked

Microsoft Visual Basic 2005: Reloaded, Second Edition

the button tool continued
The Button Tool (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the button tool continued1
The Button Tool (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the code editor window
The Code Editor Window
  • Events: user actions while program is running
  • Event procedure: set of instructions to be executed when an event occurs
  • Code editor: used to enter programming code

Microsoft Visual Basic 2005: Reloaded, Second Edition

the code editor window continued
The Code Editor Window (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the code editor window continued1
The Code Editor Window (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the code editor window continued2
The Code Editor Window (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the code editor window continued3
The Code Editor Window (continued)
  • Keyword: has special meaning in a programming language
  • Sub procedure: block of code that performs a task
  • Event’s Procedure header:
    • Begins with keyword Private
    • Procedure name includes object name and event name
    • Handles clause indicates for which objects’ events this code will execute

Microsoft Visual Basic 2005: Reloaded, Second Edition

the me close method
The Me.Close Method
  • Me.Close method: closes the current form
  • Method: predefined VB procedure that can be invoked (called)
  • Sequential processing: each line is executed in sequence

Microsoft Visual Basic 2005: Reloaded, Second Edition

the me close method continued
The Me.Close Method (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

saving a solution
Saving a Solution

Microsoft Visual Basic 2005: Reloaded, Second Edition

starting and ending an application
Starting and Ending an Application
  • Startup form: the form to be displayed when the application starts

Microsoft Visual Basic 2005: Reloaded, Second Edition

starting and ending an application continued
Starting and Ending an Application (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

starting and ending an application continued1
Starting and Ending an Application (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

starting and ending an application continued2
Starting and Ending an Application (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

starting and ending an application continued3
Starting and Ending an Application (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

starting and ending an application continued4
Starting and Ending an Application (continued)
  • Executable file:
    • Can be run outside of Visual Studio 2005
    • Has file extension of .exe

Microsoft Visual Basic 2005: Reloaded, Second Edition

starting and ending an application continued5
Starting and Ending an Application (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

using an assignment statement
Using an Assignment Statement
  • Assignment statement: assigns a value to a variable or property of a control
  • Assignment operator: the = symbol

Microsoft Visual Basic 2005: Reloaded, Second Edition

using an assignment statement continued
Using an Assignment Statement (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

using an assignment statement continued1
Using an Assignment Statement (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

printing your code
Printing Your Code

Microsoft Visual Basic 2005: Reloaded, Second Edition

closing the current solution
Closing the Current Solution
  • Closing a solution closes all projects and files in that solution

Microsoft Visual Basic 2005: Reloaded, Second Edition

closing the current solution continued
Closing the Current Solution (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

opening an existing solution
Opening an Existing Solution
  • Only one solution can be open at any one time
  • If a solution is already open, opening a different one will close the currently open solution

Microsoft Visual Basic 2005: Reloaded, Second Edition

opening an existing solution continued
Opening an Existing Solution (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

programming tutorial
Programming Tutorial

Microsoft Visual Basic 2005: Reloaded, Second Edition

programming example
Programming Example

Microsoft Visual Basic 2005: Reloaded, Second Edition

summary
Summary
  • Program: directions given to a computer
  • Programming languages have progressed from machine language to assembly language to high-level languages
  • Compiler: converts high-level languages to machine instructions
  • Object: can be seen, touched, or used
  • Objects have attributes (properties) and behaviors (methods and events)

Microsoft Visual Basic 2005: Reloaded, Second Edition

summary continued
Summary (continued)
  • Class: a pattern from which an object can be instantiated
  • Class encapsulates an object’s attributes and behaviors
  • IDE: interactive development environment
  • Windows Form Designer window: used to create GUI applications
  • Solution Explorer window: shows names of projects and files in the solution

Microsoft Visual Basic 2005: Reloaded, Second Edition

summary continued1
Summary (continued)
  • Properties window: sets an object’s property values
  • Name property: used to refer to an object in code
  • Text property of a form: specifies the text to be displayed in the title bar of the form
  • Toolbox: contains tools for creating the GUI
  • Label control: contains text that a user cannot edit
  • Event: occurs when user interacts with GUI elements

Microsoft Visual Basic 2005: Reloaded, Second Edition

summary continued2
Summary (continued)
  • Event procedure: the code that runs when an event occurs
  • Button control: performs an immediate action when clicked
  • Code editor: provides code templates for each object’s event procedures

Microsoft Visual Basic 2005: Reloaded, Second Edition