CSI 101 Elements of Computing – Spring 2009

Slides:



Advertisements
Similar presentations
CS0004: Introduction to Programming Select Case Statements and Selection Input.
Advertisements

An Introduction to Visual Basic Terms & Concepts.
VISUAL BASIC Visual Basic is derived from the Basic language (Beginner’s All-Purpose Symbolic Instruction Code) Visual Basic uses an event-driven programming.
Information System Design Lab 5&6. User Interface Design.
CVEV 118/698 Visual Basic Lecture 1 Prof. Mounir Mabsout Expert 1: Elsa Sulukdjian Expert 2: Walid El Asmar.
CVEV 118/698 Visual Basic Lecture 3 Prof. Mounir Mabsout Elsa Sulukdjian Walid El Asmar.
1 Pertemuan 02 Visual Basic Environment and Control Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
CSI 101 Elements of Computing Spring 2009 Lecture # 14 – Classes and Objects Wednesday, April 15th, 2009 and Monday, April 20th, 2009.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
VBA – Visual Basic for Applications Week 20 - Tutorial.
Microsoft PowerPoint Getting Started Guide Prepared for Towson University Dr. Jeff M. Kenton Amy Chase Martin 2007.
An Introduction to Visual Basic
Multiple Forms, Container Controls, AddHandler This presentation is based on the Forms and ContainerControls VB Projects 1.
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.
Screen ViewModule Title: Notes: Branching Instructions: Audio Script: Page: Messaging Configure the Address Book 1 Configure the Personal Address Book.
Page 1 Non-Payroll Cost Transfer Enhancements Last update January 24, 2008 What are the some of the new enhancements of the Non-Payroll Cost Transfer?
Chapter Two Creating a First Project in Visual Basic.
Exploring Microsoft Access Chapter 8 Creating More Powerful Applications: Introduction to VBA.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
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.
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Slide 1 Using Menu Bar & Common Dialog Boxes. Slide 2 Setting Up the Main Items v First open the form on which you want the menu located v Then start.
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
Word Processor Version.2. Methods Visual Basic is –Object Oriented –Event Driven Objects –Properties –Methods.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Access 2002 Advanced Form Design.
Creating New Forms Projects can appear more professional when using different windows for different types of information. Select Add Windows Form from.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 6 Looping and Multiple Forms.
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”
Chapter 8 Multiple Forms, Modules, and Menus. Introduction This chapter demonstrates how to: – Add multiple forms to a project – Create a module to hold.
Computing and Information Technology Building a Web Browser
Multiple Forms and Menus
Visual Basic Fundamental Concepts
Visual Studio 2010 Hello World CSC 230.
Chapter 2: The Visual Studio .NET Development Environment
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Chapter Topics 15.1 Graphical User Interfaces
Apply Procedures to Develop Message, Input, and Dialog Boxes
Console and GUI Programs
GUI Programming using Windows Form
3.01 Apply Controls Associated With Visual Studio Form
3.01 Apply Controls Associated With Visual Studio Form
Access Project 8 Using Visual Basic for Applications (VBA) and Creating Multi-Page Forms.
Using Procedures and Exception Handling
Apply Procedures to Develop Menus, List Box and Combo Box Objects
An Introduction to Visual Basic
Standard Controls.
Chapter 7 Advanced Form Techniques
Visual Studio 2010 Hello World CSC 230.
Visual Basic..
Chapter 6 Multiform Projects
Part A – Doing Your Own Input Validation with Simple VB Tools
Visual Basic Programming Chapter Four Notes Working with Variables, Constants, Data Types, and Expressions GROUPBOX CONTROL The _____________________________________.
Messages and Input boxes
Control Structures Part B - Message and Input Boxes
Lecture Set 11 Creating and Using Classes
CS285 Introduction - Visual Basic
Chapter 15: GUI Applications & Event-Driven Programming
Introduction to Programming
Visual C# - GUI and controls - 1
Microsoft Windows 7 Basics
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Presentation transcript:

CSI 101 Elements of Computing – Spring 2009 Lecture #11 – Structures of Visual Basic Wednesday, March 18th

Visual Basic Form Primary means for user to interact with VB application Contains Windows constructs to hold particular information We will discuss those later Most applications have more than one form Particular events cause a new form to open

Parts of a Form Title Menu Bar Tool bar Status bar Contains words Produces dropdown menus Tool bar Contains icons Status bar Bottom Contains messages or other information

Example of Parts of a Form Note you can have more than one tool bar. There is only one Title bar, menu bar, and status bar, however.

Types of Forms Splash page Main Menu (Switchboard) Data Entry First screen to appear Main Menu (Switchboard) Provides paths to major functions Most applications have screen menus as well as menu bars Easy to follow logical path to get to particular function Data Entry Reporting/Data Display

Splash Page Example

Main Menu – Simple Example

Main Menu - Functional This one takes the same philosophy as a menu bar, but has better labels

Submenu – Simple Example Obtained by clicking on the Inventory button from the form on Slide 7

Search Specifications Branch Manager Selector Tool Search Specifications Results Which best describes selection requirements? Enter some PNC Branch info º Find competitor branches near PNC branch Cost Center: Bank Number: º Find branches near specific competitor Company # Should headquarters be included in search results? Address º No (default) City State Zip º Yes Select a PNC Branch What about Denovo competitive branches? º Exclude (default) Include º º Only show Denovo Enter some Competitive Branch Info How many branches should be displayed in results? Parent Bank Name Drop list 20 Enter number between 1 and 50 Address This is a sample of data interactive screen. There are option buttons, text boxes, and command buttons. Go over each. City State Zip How many miles radius should be searched? Select a Competitor Branch 10 Enter number between 1 and 50 Search Start Over

Data Entry Sample – Text Boxes

Search Specifications Branch Manager Selector Tool Search Specifications Results Cost Center / Bank:No Address PNC Branch City State Zip Deposit Growth Deposits Market Share 2007 2006 2005 2007 2006 2005 2007 2006 2005 7% 3% Deposit Growth Deposits Market Share Denovo? HQ Bank Name Distance (mi) Address City State Zip 2007 2006 2005 2007 2006 2005 2007 2006 2005 Change Search Export All Export Selected Print All Print Selected

Components of a Form Objects Events Code Hold and display information Activities that trigger code procedures to run Code General declarations and Procedures

Types of Procedures Event Procedures Subroutines Functions Run when a particular event occurs “Attached” to a particular object Subroutines Available to any code procedure via CALL Functions Available to any code procedure

Form Events Several, but here are the common ones: Load – occurs when Form is requested Activate – occurs when Form is being displayed in preparation for starting GotFocus – occurs when Form is displayed and ready for user interaction LostFocus – occurs when user is done with Form Deactivate – occurs when Form is closing Unload – occurs when Form is being removed

Event Procedure Same structure as subroutines Name is object_event Ex: Sub Form_Load() Starts with Scope Public or Private Private by default Means only available to form Some subroutines and functions you write can be Public Available to any form or procedure in entire application

Form Event Procedure Example Private Sub Form_Load() Dim boolFlag As Boolean Dim intCount As Integer Dim strFilter As String If strFilter <> "" Then : End If End Sub

Form Objects Plenty, but the ones we’ll be working with: Text box Label – Text Command button List box Combo box – List box plus text box Checkbox – True/False Option button – Select one of a group

Object Elements Properties Events Event Code Attributes of object Ex: Caption (“label” on command button) Properties can have properties Ex: Font in text box Size, type, bold, etc Events Event Code

Object Properties Referenced with dot notation Ex: CommandOK.Caption = “OK” Ex: Text1.Font.Size = 16 Can be referenced or changed by any procedure in Form Different objects have different properties Full list of object’s properties can be seen in the Visual Basic Developer Studio I’ll go over using the Developer Studio in the next lecture

Message Box Remember when I said Form was “primary” means of communicating with user? Message Box is other Two forms: MsgBox – Message to user (one-way) InputBox – Ask for data from user (two-way) Both forms are created with a function

MsgBox function Causes a small popup window to appear in the middle of the screen Has OK button for user to click to remove popup MsgBox(<text>) Example: MsgBox(“Error! Wrong Data Type”)

InputBox function Causes popup window to appear in middle of screen Contains a text box and OK button Text parameter clues user into what to enter User enters text and clicks OK Function returns the text in text box Example: DIM Response As String Response = InputBox(“Enter number of students”)

DoCmd object Performs actions that trigger events Usually used to perform Form level actions Like opening and closing forms Can be used in any procedure Example: DoCmd.OpenForm “GetData”