Download presentation
Presentation is loading. Please wait.
Published byShavonne Richards Modified over 6 years ago
1
Visual Basic Project Development Environment
Introduction 11/9/2018 Prepared By: Deborah Becker
2
Prepared By: Deborah Becker
Introduction A brief Basic history. What is an event-driven language? Visual Basic’s unique concepts. Basic stands for Beginner’s all-purpose symbolic instructional code. It was designed as a text based language. It did not resemble the graphical language most of us have grown accustom to. When Microsoft made the decision to use Basic as their primary language, and supply it with their DOS environment, they went through several incarnation of BASIC. First came MSBASIC, then GWBASIC (Gee Whiz BASIC), BASICA, QuickBASIC, and Qbasic (still included in the windows operating system disks). Through all these evolutionary changes Microsoft kept the basic structure adding new and more powerful commands and functions. They also kept the interpreted structure of the language as apposed to converting to a compiled language. 11/9/2018 Prepared By: Deborah Becker
3
Prepared By: Deborah Becker
Lecture Topics The process of visual program design Objects, Properties, and Methods The three step method (which will be used) 11/9/2018 Prepared By: Deborah Becker
4
Prepared By: Deborah Becker
Process of Design Using VB to produce program applications that run in the windows environment. Event-driven. Cycle. Cycle Output Event-Driven When a VB program runs 1. What the user sees is a form and its controls 2. When the user clicks on a control with the mouse, types data into a text box, or presses the tab key the program changes 3. Each of these actions is called an event. Event-Driven – means that the user decides which control or object presented on the screen to activate. This is done by pointing to a control button, menu item, or input object with the mouse or using the tab key to advance from object to object on the form. Each time the user selects an object we call that an event. The basic code associated with that object will be activated at this time and will remain active until another object or control button is activated. The programming cycle includes InputProcessingoutput Input Process Test Debug Analyze Design 11/9/2018 Prepared By: Deborah Becker
5
Prepared By: Deborah Becker
Programming cycle 1. The cycle begins with the output 2. The next step consists of identifying the data needed to produce the output 3. Last step, determine how to process the input to achieve the output desired 11/9/2018 Prepared By: Deborah Becker
6
Vocabulary (good test items)
Objects—things or nouns Forms & Controls Properties—tell something about the object Color, size, location, behavior Form1.Caption Form1.Width Methods—actions associated with objects Print, Move, Resize, and Clear Form1.Print (sends output to Form1) Printer.Print (sends output to the printer) Objects 1. Forms– are the windows and dialog boxes 2. Controls– are elements that are placed inside the form Text boxes, command buttons, and list boxes Properties 1. Property references include the name of the object, a period, and the property Methods 1. They are the verbs of the OO language 11/9/2018 Prepared By: Deborah Becker
7
The Three Step Planning Process
Design the user interface Plan the properties Plan the basic code 1. Design the user interface --Decide what your application is going to do by creating an over all design. --Create the visual portion of your application (the screens and menus that you intend to incorporate into the project. 2. Plan the properties --After you have designed your screens and menu, fill out a property sheet for each of the object and controls on you screens and menus. 3. Plan the basic code --During the planning phase you will develop flow charts, Pseudocode, and Hierarchy charts. 11/9/2018 Prepared By: Deborah Becker
8
The Three Steps Programming
Construct the user interface Set the properties Write (add) the basic code (from your Pseudocode) All these plans become your documentation after the project is completed. The more documentation and detailed the planning steps are, the less time you will spend coding your project. If your fail to plan you plan to fail. Any project turn into me without documentation will be give a maximum of 50%. Programming examples 1. Define the user interface 2. Set the properties 3. Write the basic code 11/9/2018 Prepared By: Deborah Becker
9
Forms for program design are located on the Webct website.
Use these forms during your planning stage. 11/9/2018 Prepared By: Deborah Becker
10
The Visual Basic Working Environment
11/9/2018 Prepared By: Deborah Becker
11
Prepared By: Deborah Becker
Topics The parts of the Visual Basic environment How to place controls on a form How to save your project and its files The Property window’s features Accessing the code window 11/9/2018 Prepared By: Deborah Becker
12
Prepared By: Deborah Becker
The New project window 11/9/2018 Prepared By: Deborah Becker
13
Prepared By: Deborah Becker
The New Project Window 11/9/2018 Prepared By: Deborah Becker
14
Prepared By: Deborah Becker
The Toolbar Visual Basic has four toolbars Debug Edit Form Editor Standard Debug – this toolbar is used during interactive debugging to trace and correct problems Edit – is used to edit your visual basic code Form editor – is used to adjust objects on your forms Standard – this is the default tool bar that appears beneath the menu bar when you start visual basic 6. 11/9/2018 Prepared By: Deborah Becker
15
Prepared By: Deborah Becker
The toolbox Pointer Picture box Text box Label Frame button Check box Option button Horizontal and vertical Scroll bars Image box Data Control 11/9/2018 Prepared By: Deborah Becker
16
Prepared By: Deborah Becker
The Form Window 11/9/2018 Prepared By: Deborah Becker
17
Prepared By: Deborah Becker
Project Window Projects Forms Modules Class Modules User Controls User Documents Property Pages Projects – An application may consist of several projects. Multiple project files will be created when you create ActiveX Controls. Project files always have the filename extension (.VBP) Forms – The project window always contains a list or your forms. Form files always have the extension (.FRM) Modules – Your project’s modules hold general and reusable routines of Visual Basic programming statements. You can use the same module in several programs due to its general nature. Modules always have the file extension (.BAS). Class Modules – Class modules are special code modules that define objects you’ve designed for a project. Class module files always have the extension (.CLS) User Controls – User controls are ActiveX controls that you have added to the project. ActiveX files always have the extension (.OCX). User Documents – User documents are document 11/9/2018 Prepared By: Deborah Becker
18
Prepared By: Deborah Becker
The Property Window Each property has a name and a value Default names are assigned as you add controls Command1 Always Rename Always rename controls after you have placed the in the form window. 11/9/2018 Prepared By: Deborah Becker
19
Prepared By: Deborah Becker
Naming Conventions Objects Prefix Example Form frm ... frmDataEntry Command Button cmd ... cmdCalculate Label lbl ... lblTotalDue Text Box txt ... txtLastName Option Button opt … optPaid Check Box chk … chkJuniorLevel Frame fra … fraCustomerData Horizontal Scroll hsb … hsbPrice Vertical Scroll vsb … vsbDiscount Image img … imgEmployee Picture Box pic … picOutput Combo Box cbo … cboBeverage List Box lst … lstSalad Shape shp … shpLayout Look at the handout on naming conventions. These conventions are standards set by Microsoft and the Industry. The perform two valuable functions for your. The help you to read your code more easily. You can identify objects with in the code by the prefixes. By using the standards set by the industry you will find that it is easier to modify your code or someone else's. 11/9/2018 Prepared By: Deborah Becker
20
Prepared By: Deborah Becker
Getting Help Visual Basic Help Assistants and Wizards Search HTML pages Index ON-line 11/9/2018 Prepared By: Deborah Becker
21
Placing Controls on a Form
From the toolbox Click the control you desire Crosshairs Double-Click Default Center of form 11/9/2018 Prepared By: Deborah Becker
22
Prepared By: Deborah Becker
Writing The code Double click On an object Click View on The toolbar 11/9/2018 Prepared By: Deborah Becker
23
Prepared By: Deborah Becker
Types of VB Statements Remark statements ‘Gives additional information to clarify the project Assignment statements [let] Object.Property = value End statement End Halts the program Remarks are internal documentation for your program. They help you to identify what each module was designed to do. They help make programs easier to maintain. Assign statements or let statements are used to assign value to objects and variables. Other syntax statements include End. Each program your write for this class must contain an end statement that exit the program. 11/9/2018 Prepared By: Deborah Becker
24
Prepared By: Deborah Becker
Sample Code 11/9/2018 Prepared By: Deborah Becker
25
Errors, Errors Mi Kingdumb 4 Ann Error
Complier errors (syntax) Run-time errors (naming errors, etc) Logic errors (incorrect placement of instructions) 11/9/2018 Prepared By: Deborah Becker
26
Prepared By: Deborah Becker
Summary About Visual Basic Project Planning and Design Walked through the Components of the VB environment Assignment Read chapter two 11/9/2018 Prepared By: Deborah Becker
27
Where to Get More Information
Our Web-Page Come to class Read your book, web electronic sources 11/9/2018 Prepared By: Deborah Becker
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.