VISUAL BASIC Visual Basic is derived from the Basic language (Beginner’s All-Purpose Symbolic Instruction Code) Visual Basic uses an event-driven programming.

Slides:



Advertisements
Similar presentations
What Was I Thinking??. Key Terms 1. Control 1. Control 2. Design Mode 2. Design Mode 3. Event 3. Event 4. Form 4. Form 5. Interface 5. Interface 6. Properties.
Advertisements

Information System Design Lab 5&6. User Interface Design.
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Learning the Basics – Lesson 1
Chapter 1: An Introduction to Visual Basic 2012
Using Macros and Visual Basic for Applications (VBA) with Excel
Introduction to Visual Basic Programming. Lecture Outline History What is Visual Basic First Look at the VB 6.0 Environment Some VB Terminology Our first.
 2002 Prentice Hall. All rights reserved. Chapter 2 - Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Overview of the Visual Studio.NET.
Visual Basic Project 1 IDS 306 Spring 1999 V. Murphy.
Copyright © 2012 Pearson Education, Inc. Chapter 2 Introduction to Visual C#
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
Adding Controls to User Forms. Adding Controls A user form isn’t much use without some controls We’re going to add controls and write code for them Note.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Slide 1 Chapter 2 Visual Basic Interface. Slide 2 Chapter 2 Windows GUI  A GUI is a graphical user interface.  The interface is what appears on the.
Visual Basic Chapter 1 Mr. Wangler.
05/09/ Introducing Visual Basic Sequence Programming.
Microsoft Visual Basic 2005: Reloaded Second Edition
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Chapter 1 P. 1 Writing Windows applications with Visual Basic Figure 1.1 The first program works as follows: (These operations can be performed in any.
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.
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Chapter 3 Introducing Visual Basic.NET. 3.1 Visual Basic.NET Windows Programming -Used to create Windows, Web, and Console applications -Uses predefined.
Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Copyright © 2001 by Wiley. All rights reserved. Chapter 2: Using Visual Basic to Create a First Project Getting Started with VB Development Environment.
Chapter 3 Introducing Visual Basic
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Outline Software and Programming Program Structure Tools for Designing Software Programming Languages Introduction to Visual Basic (VBA)
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 INTRODUCTION TO VISUAL BASIC © Prepared By: Razif Razali 1.
Chapter Two Creating a First Project in Visual Basic.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Standard Grade Programming using VB 1 Programming Visual Basic.
What is Visual Basic.NET? 110 B-1 e.g. a word processor doesn’t do anything until the user clicks on a button, types text... A programming language that.
3.9 to  Also refer to as Program  Contains set of instructions that tells the computer how to perform specific task.  Each line of code is referred.
1.
VB Objects & Events (Exercises) School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Friday 1/31/2003)
1 Visual Basic Part I - A tool for customizing your program Principles of GIS
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 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.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
More Visual Basic!. Creating a Standalone Program A standalone program will allow you to make a program file that can be run like other Windows programs,
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Programming with Visual Basic.NET. Quick Links Program Code The Code Window The Event Procedure Assignment Statements Using AutoList Radio Buttons Buttons.
 2007 Pearson Education, Inc. All rights reserved Introduction to the Visual Basic Express 2005 IDE.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
Programming with Microsoft Visual Basic 2012 Chapter 1: An Introduction to Visual Basic 2012.
Visual Basic.NET Windows Programming
Chapter 1: An Introduction to Visual Basic 2015
3.01 Apply Controls Associated With Visual Studio Form
1. Introduction to Visual Basic
3.01 Apply Controls Associated With Visual Studio Form
Standard Controls.
Chapter 2 Visual Basic Interface
CIS16 Application Development Programming with Visual Basic
Building an Application in the Visual Basic .NET Environment
Introduction to Programming
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Presentation transcript:

VISUAL BASIC Visual Basic is derived from the Basic language (Beginner’s All-Purpose Symbolic Instruction Code) Visual Basic uses an event-driven programming model.

PROCEDURAL V. EVENT- DRIVEN PROGRAMMING Procedural Applications Application execution starts with the first line of code, and follows a predefined path through the application Event-Driven Applications Runs different code sections in response to events. Events can be triggered by the user's actions. The sequence of events determines the sequence in which the code runs. Therefore, the path through the application's code differs each time the program runs.

VISUAL BASIC EXAMPLE

VISUAL BASIC WINDOW Menu Bar Tool Bar Tool Box Project Explorer Window Properties Window Form Layout Window

STEPS TO CREATE AN APPLICATION IN VISUAL BASIC 1.Create the user interface of the application. 2.Write code that responds to actions taken in the user interface.

DEMONSTRATION

ADDING A LABEL OBJECT Is used to display information Label Properties: Name: - identifies an object - begin object name with lbl Caption:- changes the text displayed in the label Font:- changes the font, style and size Alignment: - can be set to left, right or center LABEL

ADDING A COMMAND BUTTON Is something the user can click on Label Properties: Name: - begin object name with cmd Caption:- changes the text displayed in the command button Command Button

FORM PROPERTIES An object used to hold other objects Name – begin form objects with frm Caption – changes the text displayed in the title bar

EXERCISE GO TO PAGE 3-6 WORK ON REVIEW NO. 2

PROGRAM CODE Is a set of instructions that tells the computer how to perform a specific task

EVENT PROCEDURE Is a block of code that executes in response to an event (ex. a mouse click) Ex. Done Command Button –Unload form name or Unload Me

EXERCISE GO TO PAGE 3-10 WORK ON REVIEW 3 AND 4

USING ASSIGNMENT TO CHANGE PROPERTY VALUES LABEL PROPERTIES Caption can be assigned text Font –can change the size Bold and Italic are either True or False can change the font name Alignment can be assigned 0 (left justify), 1 (right justify), or 2 (center) COMMAND BUTTONS Caption can be assigned text FORM PROPERTIES Caption can be assigned text

EXAMPLE Private Sub CMDDONE_Click() Unload FRMNAME End Sub Private Sub CMDGORDON_Click() LBLNAME.Caption = "MY NAME IS GORDON" End Sub Private Sub CMDJOHN_Click() LBLNAME.Caption = "MY NAME IS JOHN" End Sub Private Sub CMDMARY_Click() LBLNAME.Caption = "MY NAME IS MARY" End Sub

FORM LOAD EVENT PROCEDURE Is executed when a form is loaded into memory (when an application is started). Is an alternative to setting property values in the Properties window Example Private Sub Form_Load() LBLNAME.CAPTION = “MY NAME IS …” LBLNAME.ALIGNMENT = 2 End Sub

COMMENTING CODE Comments are used to explain and clarify program code for a human reader Has no effect on the way an application runs Single quotation mark ( ‘ ) must begin a comment

EXERCISE GO TO PAGE 3-13 WORK ON REVIEW NO. 5

IMAGE OBJECTS Name – begin object name with img Picture – is used to display a dialog box for selecting the graphic Stretch – can be either True or False (True means the image is resized if the image box is resized) Visible – can be either True or False IMAGE

EXERCISE GO TO PAGE 3-16 WORK ON REVIEW 6

OPERATORS AND EXPRESSIONS Exponentiation (^ ) Multiplication ( *) Division ( / ) Addition ( + ) Subtraction ( - ) BEDMAS Example: lblAnswer.Caption = 3.14 *10 ^ 2

CREATING AN EXECUTABLE FILE Visual Basic includes a compiler that translates the program code into a separate executable file An executable file can run without Visual Basic Go to File and then select Make

EXERCISE Go to Page 3-18 Complete Review 7 and 8

DEFINE THE FOLLOWING TERMS: OOP Project Statement Run time Properties window Project explorer window Code editor window Design Time Form Layout window IDE Interface Tool Box Tool Bar

Exercises Go to page 3-23 Begin working on the exercises