 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.

Slides:



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

CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Chapter 1: An Introduction to Visual Basic 2012
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Excel Project 7 Using Macros and Visual Basic for Applications (VBA) with Excel.
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.
The Initial Visual Basic Screen
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
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.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
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)
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.
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Visual Basic Chapter 1 Mr. Wangler.
05/09/ Introducing Visual Basic Sequence Programming.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Microsoft Visual Basic 2005: Reloaded Second Edition
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.
IE 411/511: Visual Programming for Industrial Applications
© 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.
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.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
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
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
Chapter Two Creating a First Project in Visual Basic.
Chapter 2 P. 1 Introducing more controls (on the Toolbox) (Fig. 2.1) - Text box - Frame - Option button - Check box - Image Example P. 44 Figure 2.2 Message.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Vocabulary in VB So Far. Assignment: Used to change the value of an object at run time Used to change the value of an object at run time.
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.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
1.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 4 Working with Variables, Constants, Data Types, and Expressions.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
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.
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,
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
 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.
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 6 Looping and Multiple Forms.
Visual Basic.NET Windows Programming
Chapter 2 – Introduction to the Visual Studio .NET IDE
1. Introduction to Visual Basic
Using Procedures and Exception Handling
Chapter 2 Visual Basic Interface
Variables and Arithmetic Operations
CIS16 Application Development Programming with Visual Basic
Introduction to Programming
Presentation transcript:

 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions that tells an application’s objects how to behave.  Object Oriented Programming - Uses classes, which are program code and data, to create objects.  Objects- can have visual representation such as a dialog box, button, Label etc.  Event-driven program – when a program runs due to an object being selected by the user.

 IDE – Integrated Development Environment. ◦ Used to create a Visual Basic application  The Visual Basic IDE consists of: ◦ Menu Bar ◦ Tool Bar ◦ Tool Box ◦ Project Window ◦ Project Explorer Window ◦ Properties Window ◦ Form Layout Window

 Menu Bar  Tool Bar  Project Window  Project Explorer Window  Properties Window  Form Layout Window

 Form – is a container object for other objects

 Objects are added during design time  The time during which the applications interface is being created.  Label object is used to display information.  Command Button object is something a user can click on.  Objects are added by clicking and moving your mouse over to the screen and dragging it across the form.

 Properties – defines its appearance, behavior, position, and other attributes.  Each type of objects have many different types of properties.

 Name – identifies an object all names should start with the prefix “lbl”.  Caption – changes the text displayed in the label  Font – used to change font style, and size.  Alignment – Changes the alignment of text in a label’s caption (left & right justify and center)

 Name – identifies the object. Prefix “cmd”. Cannot be change at runtime.  Caption – Changes the text displayed in the command button. Example: cmdCancelorDone.Caption = “Done”. Form Properties  Name – identifies an object. Prefix “frm”. Cannot change during runtime.  Caption – changes the text displayed in the title bar. Example: frmUserApp.Caption = “My Application”

 When naming an object, it should start with the appropriate prefix and then be descriptive of the object’s purpose.

 Selecting an object is done by simply clicking on it.  Resizing by using the drag handle  Marquee Selection – Selecting the pointer control and create a dash box around several objects at one time.

 File menu and select the “Save Project” command or clicking on disk icon shortcut key.  First saved – both form and project must be given descriptive names. ◦ Save the form using the same name as its Name Property and then save the project using a descriptive name of the application.

 F5 – start command  Run Menu and select run  Run icon on the toolbar Run Time  Refers to the time during which application is being executed.  A VB program can be run at any time of its development.

 Run Menu – select “End” command.  Click the End icon on the Tool Bar.

 Also refer to as Program  Contains set of instructions that tells the computer how to perform specific task.  Each line of code is referred to as a statement. Event Procedures  Is a block of code that executes in response to an event.  Event (User Event) – is a way in which the user can interact with an object, such as clicking a button.  Specific actions will be taken when the user clicks on the button.

 Container for program code.  Code Editor – is the area displaying the form module View Code buttonView Object button

 Display by double-clicking on the form.  Display by clicking on the View Code Button in the Project Explorer.  Clicking the button beside the view code button returns you back to the form.

 Removes a form from memory and ends the application.  Unload statement requires a form name to be unloaded.  If the form to be unloaded is the current form, then you could use Me ◦ Example:  Unload Me or Unload Form1

 Select object name from Object list and then a corresponding event is selected from the Event name.

 Indicates that the procedure cannot be accessed outside of the form module.  Sub declares the procedures  End Sub – ends the Sub statement.  Body is between Sub and End Sub statements.

 The interface and program code of an application are printed by selecting the print command from the file menu  CTRL + P Removing a Project from the IDE  File menu – Select the Remove Project command.

 Assignment – is used to change the value of an object property at run time.  Assignment Statement changes property values using the equal sign (=).  Each Object property can only be assigned a valid property values.

 Is displayed when typing an object’s name and a dot operator notation mark.

 Name – Cannot be change during run time by an assignment statement  Caption – Text in double Quote lblMessage.Caption = “Adios”  Font – has several Subproperties Size – 0 – 2048  Example: lblMessage.Font.Size = 10 Bold & Italic are True or False  Example: lblMessage.Font.Bold = True Name – enclosed in double quote  lblMessage.Font.Name = “Arial”  Alignment – 0 – left, 1 – right, 2 – center

 Event procedures can also be written for form events.  The Form_Load event procedure is executed when the form is loaded into memory.(Application is started or run)  Examples Private Sub Form_Load() lblSample.Caption = “This text is centered.” lblSample.Alignment = 2 End Sub

 Changing object property values in the Form_Load event procedure is alternative to setting property values in the Properties window.  Initializing the form – Setting object properties through the Form_Load event.

 Comments – are used to explain and clarify program code for a human reader.  No effect on how the application runs.  Single quotation mark (‘) begins a comment  Mark code that is ambiguous or misleading.  Example: lblSample.Alignment = 0 ‘left justify  All programs should state the following: ◦ ‘ Author: Your Name ◦ ‘ Date: Current Date ◦ ‘ Chapter and Exercises

 File menu – Open Project  CTRL + O  Open Project Button on the Tool Bar

 Makes programs more interesting  Makes it easier to interact with.

 Located in the Tool Box  Used to create Images

 Name – Use the img prefix when naming and image.  Picture – is used to display a dialog box for selecting the graphic to display in the image area.  Stretch – True or False – True if it has been resized. False otherwise.  Visible – True or False – To display at run time Visible = True. To hide Visible = False.

 Displays as a box, when added to a form.

 Go to Property box and select Picture. Click on box on ellipsis.  Stretch should be set to true so image will fit in the image box. Click event  Is when the user clicks on an image object to perform an action.

 Built-in arithmetic operators ◦ “^” - exponential ◦ “*” - multiplication ◦ “/” – division ◦ “\” – Integer division ◦ “Mod” - Modulus ◦ “+” - addition ◦ “-” - subtraction

 Arithmetic operators are used to form expressions.  Expression can be anywhere a numeric value is allowed ◦ Example: lblAnswer.Caption = 3.14 * 10^2 ◦ Expressions are NOT enclosed in quotes.

 Exponentiation  Multiplication and Division Left to Right  Addition and Subtraction Left to Right  You can change order of precedence by using parentheses.

 Always use parentheses when any ambiguity or maybe questions about the expression.

 Visual Basic also has a compiler that translate the program code into separate executable file.  Executable file can be run on any Computer that uses Windows 95 or later.  Visual Basic acts as an interpreter that reads each line of program code as it is entered.  Visual Basic will highlight any errors immediately.  Interpreter executes the code line-by-line and displays the output in the IDE.

 ALT + Q  File menu – Exit

 Create the program interface first  Name all objects before writing and code.  Use Object list in Code Editor window to select the object event procedure.