CIS16 Application Development Programming with Visual Basic

Slides:



Advertisements
Similar presentations
Information System Design Lab 5&6. User Interface Design.
Advertisements

Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Chapter 1: An Introduction to Visual Basic 2012
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Chapter 1: An Introduction to Visual Basic.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Using the Visual Basic Editor Visual Basic for Applications 1.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Visual Basic Chapter 1 Mr. Wangler.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
Microsoft Visual Basic 2005: Reloaded Second Edition
An Introduction to Visual Basic
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
IE 411/511: Visual Programming for Industrial Applications
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT.
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Chapter 3: Using GUI Objects and the Visual Studio IDE.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
Chapter Two Creating a First Project in Visual Basic.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
1.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Programming with Microsoft Visual Basic 2012 Chapter 1: An Introduction to Visual Basic 2012.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter One An Introduction to Visual Basic 2008.
Dive Into® Visual Basic 2010 Express
Chapter 3: I Need a Tour Guide (Introduction to Visual Basic 2012)
Chapter 1: An Introduction to Visual Basic .NET
Visual Basic.NET Windows Programming
Chapter 2: The Visual Studio .NET Development Environment
Chapter 1: An Introduction to Visual Basic 2012
Chapter 1: An Introduction to Visual Basic 2015
Visual Basic Code & No.: CS 218
Introduction to Computer CC111
Chapter 8: Writing Graphical User Interfaces
Chapter 2 – Introduction to the Visual Studio .NET IDE
An Introduction to Computers and Visual Basic
3.01 Apply Controls Associated With Visual Studio Form
1. Introduction to Visual Basic
3.01 Apply Controls Associated With Visual Studio Form
An Introduction to Computers and Visual Basic
Using Procedures and Exception Handling
Microsoft Office Illustrated
Chapter 2 Visual Basic Interface
Program and Graphical User Interface Design
Chapter 2 – Introduction to the Visual Studio .NET IDE
Hands-on Introduction to Visual Basic .NET
Programming with Microsoft Visual Basic 2008 Fourth Edition
Visual Studio.
An Introduction to Computers and Visual Basic
Presentation transcript:

CIS16 Application Development Programming with Visual Basic Chapter One An Introduction to Visual Basic

Visual Studio Visual Basic is an object-oriented programming language (OOP) Object: anything that can be seen, touched, or used Class: a pattern used to create an object Instance: an object created from a class; object is said to be instantiated Integrated Development Environment (IDE): Contains all the tools and features needed to create, run, and test programs Download a free copy at https://visualstudio.microsoft.com/downloads/

Visual Studio (cont'd.) Used to create software applications Application: program or suite of programs Windows-based application: Has a Windows user interface User interface: what the user sees and interacts with when using an application Runs on a personal computer Web-based application: Has a Web user interface Runs using a web server Accessed with a computer browser

Creating a Visual Basic Windows Application Windows applications consist of 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 portion of the solution A solution may contain one or more projects

Visual Studio IDE

Setting OPTIONS

Create a new Visual Basic Windows Application New Project dialog box

A Visual Basic Windows Application Solution and Visual Basic Project

The Windows Form Designer Window Allows you to create (design) the GUI Graphical user interface (GUI): What the user sees and interacts with Windows Form object (or form): Foundation for the user interface Add other objects such as buttons/text boxes to form Title bar with caption and Minimize, Maximize, and Close buttons Tab at top of designer window has Form1.vb [Design]

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

The Solution Explorer Window – Types of project files(cont'd.) Source file A file containing program instructions (code) Form file A file containing code associated with a Windows form Give each form file a meaningful name using the Properties window

The Properties Window Properties Properties window A set of attributes that determine an object’s appearance and behavior Properties window Displays properties of the selected object Default property values are assigned when an object is created 20

Properties of a Windows Form Class definition Block of code that defines the attributes and behaviors of an object All class definitions are contained in namespaces Namespace: Defines a group of related classes Dot member access operator The period that separates words in an object’s name to indicate a hierarchy of namespaces

Properties of a Windows Form (cont'd.) Name and Text Properties Assign meaningful names to forms and use a naming convention Pascal case First letter of each word in the name is uppercase First part of name is object’s purpose Second part of name is object’s class i.e. EmployeeDataForm Text property Controls the caption displayed on form’s title bar

The Toolbox Window Toolbox Controls Contains objects that can be added to other objects, such as a form Each tool has an icon and a name to identify it Each tool represents a class from which objects, called controls, can be created Controls Objects displayed on a form Represented as icons in the toolbox Controls on a form can be selected, sized, moved, deleted, locked in place on the form and unlocked

The Toolbox Window (cont’d.)

The Toolbox Window (cont’d.) Control names use camel case Camel case: Lowercase first word; uppercase first letter of each subsequent word in the name for labels used as prompts, it is not necessary to assign meaningful names because they are never used in code Labels used for output should have meaningful names Label control: Displays text that user cannot edit Used as “prompts” to explain controls or display output Name should end with “Label” i.e. subtotalLabel

The Toolbox Window (cont’d.) Button control Performs an immediate action when clicked Its name should end with “Button” Picture Box Control Displays an image on the form

The Code Editor Window Events: Event procedure: Code editor window: User actions while program is running Examples: clicking, double-clicking, scrolling Event procedure: Set of instructions to be processed when an event occurs Tells the object how to respond to an event Code editor window: Used to enter event procedure’s code

The Code Editor Window (cont'd.)

The Code Editor Window (cont'd.) Class statement Used to define a class Class Name list box Lists the names of objects (controls) included in the user interface Method Name list box Lists the events to which the selected object is capable of responding Method: Predefined VB procedure that can be invoked (called) when needed

The Code Editor Window (cont'd.) Event code template has a procedure header and a procedure footer Begins with keywords Private Sub Procedure name includes object name and event name Handles clause indicates for which objects’ events this code will execute

The Code Editor Window (cont'd.) Keyword A word with special meaning in a programming language Me keyword: refers to the current form Me.Close() instruction Closes the current form at run time If the current form is the only form, the application is terminated

The Code Editor Window (cont'd.) Sub procedure Block of code that performs a task Sequential processing Each line is executed in sequence Also called a sequence structure Syntax rules of the programming language

Starting and Ending an Application When you start a VB application, the IDE creates an executable file Executable file Can be run outside of Visual Studio Has a file extension of .exe Stored in the project’s bin\Debug folder

Syntax Errors Syntax error Occurs when you break one of the programming language’s rules Most syntax errors are caused by typing errors Rest the mouse pointer on the mistyped instruction to see details about the error

Syntax Errors (cont’d.) Syntax error in the exitButton’s Click procedure Result of placing the mouse pointer on the jagged blue line

Syntax Errors (cont’d.) Syntax errors should be corrected before starting an application If you start an application with a syntax error, a dialog box appears Syntax error message Result of starting an application that contains a syntax error

Bugs Bug Debugging An error in a program’s code The process of locating and correcting bugs in a program

Closing the Current Solution Closing a solution closes all projects and files in that solution You are prompted to save any files that have unsaved changes

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