Chapter 3 (ctd) Section 3.2 EVENTS. Three stages in the creation of a Visual Basic program: zCreate the interface yie, choose & create the objects zSet.

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

VISUAL BASIC Visual Basic is derived from the Basic language (Beginner’s All-Purpose Symbolic Instruction Code) Visual Basic uses an event-driven programming.
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Chapter 6 Multiform Projects Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Visual Basic Project Files:.VBP file: Project File: a small text file that contains the names of other files in the project, as well as some information.
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.
Exploring Microsoft Access Chapter 8 Creating More Powerful Applications: Introduction to VBA By Robert T. Grauer Maryann Barber.
Chapter 3 (ctd) Sections (partial) Input/Output NUMBERS & STRINGS.
Visual Basic Project Files:.VBP file: Project File: a small text file that contains the names of other files in the project, as well as some information.
Compunet Corporation Programming with Visual Studio.NET GUI Week 13 Tariq Aziz and Kevin Jones.
The Initial Visual Basic Screen
Introduction to Computing Dr. Nadeem A Khan. Lecture 7.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 2 Tariq Aziz and Kevin Jones.
Visual Basic Project 1 IDS 306 Spring 1999 V. Murphy.
Event-Driven Programming and Access Events
Chapter 4 (cont) Sec. 4.1, 4.2, 4.4 Procedures (User-defined)
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 بسم الله الرحمن الرحيم Palestine Polytechnic University College of Administrative science and.
Chapter 3 (Section 3.1) Fundamentals of Programming in Visual Basic Objects.
Section Schneider zThis section introduces nice ways to produce input & display output: yInput boxes yMessage boxes.
Introduction to Visual Basic Chulantha Kulasekere.
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.
CS0004: Introduction to Programming Events. Review  Event Procedure  A set of instructions to be executed when a certain event happens.  Many event-driven.
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.
An Object-Oriented Approach to Programming Logic and Design
Automating Tasks with Visual Basic. Introduction  When can’t find a readymade macro action that does the job you want, you can use Visual Basic code.
Chapter 11: Introduction to the Visual Basic Environment Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
® Microsoft Access 2010 Tutorial 11 Using and Writing Visual Basic for Applications Code.
An Introduction to Visual Basic
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Multiple Forms, Container Controls, AddHandler This presentation is based on the Forms and ContainerControls VB Projects 1.
1 1 Lab1 Ismail M. Romi – IT Dept, PPU, Visual Basic 2005 Programming Tour.
Let’s get started using Visual Basic!. Private Sub cmdGo_Click... Dim strMessage As String Dim sngSum As Single If IsNumeric(txtNumber1.Text) = False.
Chapter 3 – Fundamentals of Programming in VB.NET VB.NET Controls VB.NET Events Numbers Strings Input and Output.
Chapter 8: Writing Graphical User Interfaces Visual Basic.NET Programming: From Problem Analysis to Program Design.
Introduction to Visual Basic.NET Chapter 2 Introduction to Controls, Events.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Introduction to Visual Basic.NET Your First Visual Basic.NET Application.
Advanced Object- Oriented Programming Programming Right from the Start with Visual Basic.NET 1/e 14.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Multiform Projects.
Chapter Two Creating a First Project in Visual Basic.
Dialog Boxes – Day 1 Built-in Dialog Boxes Input Box Message Box Custom Dialog Boxes – User Forms.
Exploring Microsoft Access Chapter 8 Creating More Powerful Applications: Introduction to VBA.
Illustration of a Visual Basic Program Running an Ada Program 1 by Richard Conn 11 September 1999.
3.2 VB.NET Events An Event Procedure Properties and Event Procedures of the Form Tab Order of Controls Exercises.
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.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Chapter 3 - VB.NET by Schneider1 Chapter 3 – Fundamentals of Programming in VB.NET Part I VB.NET Controls VB.NET Events.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
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.
Chapter 31 Fundamentals of Programming in Visual Basic (VB) Visual Basic Events Simple Statement.
COMPREHENSIVE Access Tutorial 11 Using and Writing Visual Basic for Applications Code.
Chapter 31 Fundamentals of Programming in Visual Basic (VB) Visual Basic Events Simple Statement.
Programming with Visual Basic.NET. Quick Links Program Code The Code Window The Event Procedure Assignment Statements Using AutoList Radio Buttons Buttons.
Chapter 7 Multiple Forms, Modules, and Menus. Section 7.2 MODULES A module contains code—declarations and procedures—that are used by other files in a.
Chapter 8 Multiple Forms, Modules, and Menus. Introduction This chapter demonstrates how to: – Add multiple forms to a project – Create a module to hold.
Visual Basic.NET Windows Programming
Visual Basic Code & No.: CS 218
Chapter Topics 15.1 Graphical User Interfaces
An Introduction to Visual Basic
Event Driven Programming
Objectives Learn about Function procedures (functions), Sub procedures (subroutines), and modules Review and modify an existing subroutine in an event.
Visual Basic: Week 5 Review User defined functions
Fundamentals of Programming in VB.Net
Chapter 15: GUI Applications & Event-Driven Programming
Tutorial 11 Using and Writing Visual Basic for Applications Code
Presentation transcript:

Chapter 3 (ctd) Section 3.2 EVENTS

Three stages in the creation of a Visual Basic program: zCreate the interface yie, choose & create the objects zSet the objects’ properties yuse the properties window of each object zCreate the code to respond to a user’s interaction with the objects zExamplesExamples

Responding to events zWe can write code to respond to user’s actions. zA user’s actions are called events. zEvent-driven programs are ones in which specific groups (or modules) of statements are executed on the basis of what the user does. zIn this section, we focus on statements that respond to a user’s actions by changing the properties of objects.

Basic features of an event procedure zFirst, invoke the window of an object by double-clicking on the object. double-clicking zFormat: Private Sub ObjectName_Event() Visual Basic code goes here End Sub Private Sub ObjectName_Event() Visual Basic code goes here End Sub

ExampleExample from text, pp zNote the interface for the example: ObjectProperty Setting WalkthroughCaption Demonstration txtPhraseText (blank) cmdBoldCaption Make Phrase Bold zLet’s create it

zThe text box txtPhrase has 2 events written for it: ytxtPhrase_LostFocus ytxtPhrase_GotFocus zThe command button cmdButton has 1 event written for it: ycmdBold_Click

Lab Assignment (Lab2) zCreate the forms, objects & events for p. 69: 38, 39, 40 Due today!

Homework Assignment (HW2) zDue next Tuesday zPage 70, #46, #47.