Microsoft Visual Basic 2005: Reloaded

Similar documents
Skill Area 336 Explain Essential Programming Concept. Programming Language 2 (PL2)

Skill Area 336 Explain Essential Programming Concept. Programming Language 2 (PL2)

Using Visual Basic Studio 2008

Microsoft Visual Basic 2005: Reloaded

LESSON B. The Toolbox Window

LESSON A. The Splash Screen Application


VB.NET. Exercise 1: Creating Your First Application in Visual Basic.NET

Introduction to the Visual Studio 2005

Introduction to Programming Microsoft.NET Applications with Visual Studio 2008 (C#)

An Overview of Visual Basic.NET: A History and a Demonstration

CIS 3260 Intro. to Programming with C#

Chapter 1: A First Program Using C#

CIS 3260 Intro. to Programming with C#


2559 : Introduction to Visual Basic.NET Programming with Microsoft.NET

Visual Basic.NET Programming Introduction to Visual Basic.NET. (Part I of IV)

2. A GUI A. uses buttons, menus, and icons B. should be easy for a user to manipulate C. both (a) and (b) D. stands for Graphic Use Interaction

Chapter 12. OOP: Creating Object- Oriented Programs. McGraw-Hill. Copyright 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.

M Introduction to Visual Basic.NET Programming with Microsoft.NET 5 Day Course

UNIT 1. Introduction to Microsoft.NET framework and Basics of VB.Net

Chapter 12. OOP: Creating Object-Oriented Programs The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Developing Microsoft.NET Applications for Windows (Visual Basic.NET)

Lecture 1 Introduction Phil Smith

CHAPTER 5 GENERAL OOP CONCEPTS

Dive Into Visual C# 2008 Express

Getting started 7. Storing values 21. Creating variables 22 Reading input 24 Employing arrays 26 Casting data types 28 Fixing constants 30 Summary 32

INTRODUCTION TO.NET. Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.)

Tutorial 2 - Welcome Application Introducing, the Visual Studio.NET IDE

Program and Graphical User Interface Design

Object Orientated Analysis and Design. Benjamin Kenwright

Introduction to.net Framework and Visual Studio 2013 IDE MIT 31043, Visual Programming By: S. Sabraz Nawaz

CIS Intro to Programming in C#

Object oriented programming Concepts

INTRODUCTION TO VISUAL BASIC 2010

Programming Languages and Program Development

New programming language introduced by Microsoft contained in its.net technology Uses many of the best features of C++, Java, Visual Basic, and other

Advanced Object-Oriented Programming. 11 Features. C# Programming: From Problem Analysis to Program Design. 4th Edition

Analysis of the Benchmark while Extracting Data from Database or XML File for Different Platforms

DOT NET Syllabus (6 Months)

Object-Oriented Programming

Introduction to.net Framework and Visual Studio 2013 IDE MIT 31043, Rapid Application Development By: S. Sabraz Nawaz

Program Contents: DOTNET TRAINING IN CHENNAI

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

Chapter 5 Object-Oriented Programming

Welcome Application. Introducing the Visual Studio.NET IDE. Objectives. Outline

Install using the Umbraco Package Manager

Introduction to.net Framework Week 1. Tahir Nawaz

Software Development. Modular Design and Algorithm Analysis

C # Coding Standards for.net By Lance Hunt. Document Version 1.13 August Copyright Lance Hunt 2004 All Rights Reserved

Computer Science 4U Unit 1. Programming Concepts and Skills Modular Design

Discovering Computers 2008

C # Coding Standards for.net By Lance Hunt. Document Version 1.13a August Copyright Lance Hunt 2004 All Rights Reserved

I101/B100 Problem Solving with Computers

Unit 1: Visual Basic.NET and the.net Framework

Oops known as object-oriented programming language system is the main feature of C# which further support the major features of oops including:

Introduction to Microsoft.NET Framework Programming using VS 2005 (C#)

Instructions for writing Web Services using Microsoft.NET:

Chapter 2. Building Multitier Programs with Classes The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Chapter 1. Introduction to Computers and Java Objects. Background information. » important regardless of programming language. Introduction to Java

Visual Basic 2008 The programming part

Limnor Studio Getting Started

REVIEW OF CHAPTER 1 1

Developing Windows Applications with Microsoft Visual Studio 2010

Contents About This Guide... 5 About Notifications... 5 Managing User Accounts... 6 Managing Companies Managing Password Policies...

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

JAVA: A Primer. By: Amrita Rajagopal

Introduction to Computers and Java

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

Chapter 2 Exploration of a Visual Basic.Net Application

SYLLABUS B.Com (Computer) VI SEM Subject Visual Basic Unit I

PESIT- Bangalore South Campus Hosur Road (1km Before Electronic city) Bangalore

Fundamental C# Programming

Classes, objects, methods and properties

Konark - Writing a KONARK Sample Application

Readme. HotDocs Developer Table of Contents. About This Version. About This Version. New Features and Enhancements

Introduction to the Visual Studio.NET Integrated Development Environment IDE. CSC 211 Intermediate Programming

Introduction to OOP Using Java Pearson Education, Inc. All rights reserved.

Low-Level Languages. Computer Programs and Programming Languages

IT 374 C# and Applications/ IT695 C# Data Structures

Developing Data Access Solutions with Microsoft Visual Studio 2010

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2003

DC69 C# &.NET JUNE C# is a simple, modern, object oriented language derived from C++ and Java.

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

Introduction to Computers and Java

Introduction. Programming and

Visual Basic.NET. 1. Which language is not a true object-oriented programming language?

Advanced Programming Using Visual Basic 2008

Introduction to Object-Oriented Programming

Introduction to OOP. Procedural Programming sequence of statements to solve a problem.

Building non-windows applications (programs that only output to the command line and contain no GUI components).

Building Web Sites Using the EPiServer Content Framework

C# Syllabus. MS.NET Framework Introduction

Introduction to Computers and Java

PROGRAMMING IN C++ COURSE CONTENT

Introduction to.net, C#, and Visual Studio. Part I. Administrivia. Administrivia. Course Structure. Final Project. Part II. What is.net?

1. A Web Form created in Visual Basic can only be displayed in Internet Explorer. True False

Lab 4: Introduction to Programming

Datastore Model Designer

SECURED PROGRAMMING IN.NET DETAILED TRAINING CONTENT INDUSTRIAL TRAINING PROGRAM ( )

Transcription:

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 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 2

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 3

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 4

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 5

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 6

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 highlevel language to machine code Interpreter: translates high-level instructions lineby-line as the program runs Compiler: translates entire program into machine code before running the program Microsoft Visual Basic 2005: Reloaded, Second Edition 7

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 8

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 9

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 10

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 11

OOP Terminology (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 12

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 13

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 14

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 15

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 16

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 17

The Common Language Runtime (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 18

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 19

Solutions, Projects, and Files (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 20

Starting Microsoft Visual Studio 2005 Microsoft Visual Basic 2005: Reloaded, Second Edition 21

Starting Microsoft Visual Studio 2005 (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 22

Starting Microsoft Visual Studio 2005 (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 23

Creating a Visual Basic 2005 Windows-Based Application Microsoft Visual Basic 2005: Reloaded, Second Edition 24

Creating a Visual Basic 2005 Windows-Based Application (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 25

Creating a Visual Basic 2005 Windows-Based Application (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 26

Managing the Windows in the IDE Microsoft Visual Basic 2005: Reloaded, Second Edition 27

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 28

The Windows Form Designer Window (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 29

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 30

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 31

The Solution Explorer Window (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 32

The Solution Explorer Window (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 33

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 34

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 35

The Properties Window (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 36

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 37

Properties of a Windows Form Object Microsoft Visual Basic 2005: Reloaded, Second Edition 38

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 39

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 Text property: controls the caption displayed on form s title bar StartPosition property: 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 40

Properties of a Windows Form Object (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 41

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 42

The Toolbox Window (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 43

The Toolbox Window (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 44

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 45

The Label Tool (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 46

The Label Tool (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 47

The Button Tool Button tool: represents a button control Button control: Performs an immediate action when clicked Microsoft Visual Basic 2005: Reloaded, Second Edition 48

The Button Tool (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 49

The Button Tool (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 50

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 51

The Code Editor Window (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 52

The Code Editor Window (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 53

The Code Editor Window (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 54

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 55

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 56

The Me.Close Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 57

Saving a Solution Microsoft Visual Basic 2005: Reloaded, Second Edition 58

Starting and Ending an Application Startup form: the form to be displayed when the application starts Microsoft Visual Basic 2005: Reloaded, Second Edition 59

Starting and Ending an Application (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 60

Starting and Ending an Application (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 61

Starting and Ending an Application (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 62

Starting and Ending an Application (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 63

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 64

Starting and Ending an Application (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 65

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 66

Using an Assignment Statement (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 67

Using an Assignment Statement (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 68

Printing Your Code Microsoft Visual Basic 2005: Reloaded, Second Edition 69

Closing the Current Solution Closing a solution closes all projects and files in that solution Microsoft Visual Basic 2005: Reloaded, Second Edition 70

Closing the Current Solution (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 71

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 72

Opening an Existing Solution (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition 73

Programming Tutorial Microsoft Visual Basic 2005: Reloaded, Second Edition 74

Programming Example Microsoft Visual Basic 2005: Reloaded, Second Edition 75

Summary Program: directions given to a computer Programming languages have progressed from machine language to assembly language to highlevel 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 76

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 77

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 78

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 79