IS 118 Introduction to Development Tools

Slides:



Advertisements
Similar presentations
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Advertisements

CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
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.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 06.
Chapter 1: An Introduction to Visual Basic.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Using the Visual Basic Editor Visual Basic for Applications 1.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Creating a Console Application with Visual Studio
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
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.
A First Program Using C#
Visual Basic Chapter 1 Mr. Wangler.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
Introduction to Visual Basic (VB)
05/09/ Introducing Visual Basic Sequence Programming.
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.
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.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Introduction to Visual Basic.NET Programming In Visual Basic.NET.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Copyright © 2001 by Wiley. All rights reserved. Chapter 2: Using Visual Basic to Create a First Project Getting Started with VB Development Environment.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
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.
OCC Network Drives  H:\  P:\ 
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Chapter Two Creating a First Project in Visual Basic.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
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.
1.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
Chapter 1 Introduction Visual Basic.NET. Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi 2 Objectives Explain what Visual Basic is Contrast.
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.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
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 C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
 2007 Pearson Education, Inc. All rights reserved Introduction to the Visual Basic Express 2005 IDE.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 1: An Introduction to Visual Basic .NET
Visual Basic.NET Windows Programming
Chapter 2: The Visual Studio .NET Development Environment
Chapter 1: An Introduction to Visual Basic 2015
1. Introduction to Visual Basic
Chapter 2 Visual Basic Interface
Hands-on Introduction to Visual Basic .NET
CIS16 Application Development Programming with Visual Basic
Presentation transcript:

IS 118 Introduction to Development Tools VB Chapter 01-02 IS 118

Things to Cover What is Visual Basic – (VB) Chapter 2 How it operates vs. Others Sound Program Criteria Chapter 2 The IDE Forms, and Controls Events, properties and methods Coding and Naming conventions Running Executables IS 118

Note For These chapters we will follow the book and you should follow along on your computer as we do it IS 118

Evolution of Visual Basic Evolved from BASIC (Beginner’s All-Purpose Symbolic Instruction Code) Designed to provide interactive computing on mainframe computers Widely available on early microcomputers Introduction of personal computers (early 1980’s) Microsoft introduced GW-Basic with the DOS operating system IS 118

Language Processors Required to process programs into a program the computer can understand Interpreters Read, interpret, and carry out one line of code at a time Compilers Translate a source program (i.e. one written in VB) Create an object program (one a machine can read) Object programs also called “executables” Compiled programs run much faster IS 118

Characteristics of Visual Basic Provides visual objects (controls) that can be drawn onto a window (form) Makes building the interface much easier Object-oriented code structure Code structured around objects Easy to understand syntax “IntelliSense” technology helps write code Objects can be reused and extended through inheritance Event-driven language Things happen in response to events Examples of events: mouse click, opening or closing a window The user, not the program determines the sequence of operations IS 118

Creating a VB Program Takes place in the Visual Studio Integrated Development Environment (IDE) Provides an environment for creating the interfaces, writing and testing code, and making changes Provides the .NET framework for Web services, Visual C#.NET, Visual Basic.NET, etc. Statement: an instruction that can stand alone Code: a group of statements IS 118

Overview of VB Program Development Criteria of a sound application Internal criteria geared to the programmer External criteria geared to the user Program development cycle Understand distinct steps in the process of developing an application IS 118

External Criteria Functionality Efficiency User-Friendliness Does the program do what it is supposed to do? Efficiency Program should minimize the use of computer resources Includes memory, processing time, and storage space User-Friendliness Make the application easy to use Includes helpful error messages, guarding against user errors, consistent appearance and behavior of windows IS 118

Internal Criteria Consistency in coding style Following conventions most programmers follow Indenting blocks of code Naming objects with predefined prefixes Code clarity and readability Use meaningful variable names Adding comments to code can aid understanding Modularity in code design Each block of code is isolated from the rest of the program Easier to debug, review, and revise IS 118

Internal Criteria Elegant algorithms Code maintainability Algorithm: a systematic approach to solving the programming problem Logic easy to trace and implement Efficient in terms of speed and storage requirements Code maintainability General applicability: code will not require revision even if the program requirements change IS 118

Steps in Developing a Program Developing an application requires several distinct steps Skipping or not giving careful attention to steps can create a lot of rework, headaches, and expense Mistakes made in the earlier stages of program development require much more time, money, and hassle to rework IS 118

Steps in Program Development Analyze and define the problem Program must meet application needs Design the visual interface Decide what data fields appear and the appropriate controls Define User-Program Interaction Define events, both user actions and system activities IS 118

Steps in Program Development Design the code structure Structure dictated by responses program should carry out Well-designed code enhances maintainability Write Code Develop code based on your analysis of the problem and design of the structure IS 118

Steps in Program Development Test and edit the program Various error types: Syntax errors: failure to follow programming rules Semantic errors: failure to say what you mean Logic errors: difference between what programmer thinks code will do and what it actually does Place the program into production Production program works with live data and produces “real” results IS 118

Learning the Language Comparing learning a spoken language and learning a programming language Vocabulary Types of objects, methods, and events Grammar Syntax rules Semantics Meaning of how programming constructs fit together Effectiveness Finding better ways to express the same idea IS 118

Hands-on Practice Programming is a skill, like playing a sport or a musical instrument Practice enables you to gain familiarity with: The IDE The vocabulary and syntax rules of VB How different parts of the code fit together Identify opportunities for code improvement IS 118

The IDE –lets do it IS 118

Summary Visual Basic evolved from BASIC Visual elements allow easy changes in user interface Object-oriented syntax makes it easier to learn vocabulary and syntax Object-oriented language enhances code reusability Inheritance allows programmer to reuse code IS 118

Summary Sound programs must meet internal criteria and external criteria There are distinct steps in developing code. Don’t try to shortcut the early stages Learning a programming language is like learning a spoken language PRACTICE, PRACTICE, PRACTICE IS 118

Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET Copyright (c) 2003 by Prentice Hall

Objectives Navigate the IDE Create controls on a form and adjust their sizes Understand the events, properties, and methods of controls Understand how the code and events work in a VB program IS 118

Objectives Open and save a VB project Understand the coding mechanics and the naming convention Get help from the MSDN help system Enumerate the types of statements in a program Run an executable without the IDE IS 118

The IDE Profile IS 118

Starting the IDE The Visual Studio Start Page IS 118

Starting a New Project Default: Windows Application IS 118

The Integrated Development Environment (IDE) Menu bar provides many menu items Examples include File and Edit menus Toolbar lies below menu bar Provides shortcuts to the menu bar Toolbox Contains various icons representing VB controls Solution Explorer Shows all forms, references, classes, and modules the current project contains IS 118

The IDE Menu bar Toolbar Toolbox Blank form in IDE IS 118

Solution Explorer and Properties Window Solutions Explorer shows all the forms, references, classes, and modules in the project Properties window shows all the properties of the selected object IS 118

Your First Visual Basic Program Form contains a label and a button Double-click the button on the form to open the code window IS 118

The Code Window Tabs at top let you toggle between the form and the code window Procedure box lists events the object in the object box recognizes Object box lists all objects in the form Comments appear green in the IDE Object-oriented syntax: object and property separated by dot (period) IS 118

When You Run the Program Label changes when you click the Say Welcome button IS 118

Understanding the IDE Design time Runtime When you are placing controls on the form When you are writing code in the code window Runtime When the code in your project comes to life, responding to events Press Start on the Debug menu in the IDE Press the F5 key in the IDE Press the start button in the IDE IS 118

Coding Mechanics Comments Showing Blocks of Code Line Continuation Used to provide clues to the purpose of the code Begin with tick mark (apostrophe) or Rem Appear green in the IDE Showing Blocks of Code The IDE will help indent the code lines Line Continuation If you have to write a long statement, break into lines by using the underscore (_) character IS 118

Interfaces of VB Objects Forms and controls are objects Objects have interfaces: Properties: typically relate to appearance of objects Events: user or system actions recognized by the object Procedures written to handle events Methods: actions that objects are capable of performing IS 118

Properties Special types of data associated with object Most relate to appearance of objects i.e. Label1.BackColor = Color.Red Some relate to behavior of objects i.e. btnNext.Enabled – True Object and property separated by dot (period) Property must be given a value IS 118

Events User or system actions the object recognizes Event procedure i.e. a button has a Click event Event procedure Procedure written to handle a specific event Also called event handler Syntax: Private Sub ObjectName_Event Code surrounded by Sub … End Sub Private refers to the scope of the procedure Object and event separated by underscore IS 118

Methods Actions objects are capable of performing i.e. Me.Close() Syntax: Object.Method(Parameter List) Parameter list: arguments passed in to the method Parameter list must be enclosed in parentheses, even if no parameters are required IS 118

Getting Help from the Help Menu Enter search term in the Look for box Double-click an item in the list box Double-click an item in the lower center pane; upper center pane shows results IS 118

Naming objects When naming objects, be descriptive Use standard prefixes, i.e. lbl for label Give the object a meaningful name i.e. a label with text “Name” could be lblName Change the object name in the Properties window Name objects before placing code in the code window IS 118

Assignment Statements Generate some sort of result i.e. moving data from one location in memory to another Syntax: lblWelcome.Text = “Welcome” Expression on right hand side of equation moved to memory location on left hand side Most common statements in VB programs IS 118

Statements That Direct Execution Flow Conditional Execution One block of code executed if a statement is true; a different block executed if false If block is most common example Repetition When you need to execute a block of code repetitively For…Next loop is most common Code that “Jumps” Exit Sub exits a procedure IS 118

Completing the Development Cycle Program must be compiled into executable When you test run your program, the IDE compiles and saves the executable To run the program: Double-click the executable Use the Run option off the Start menu Add the executable to your Start menu IS 118

Finding the Executable Executable is found in the /bin folder underneath the folder containing your project. In this case: C:\My Documents\ Visual Studio Projects\Welcome IS 118

Summary Start the IDE from the Start Menu Choose Visual Studio.NET from Programs menu Edit your profile to customize environment Menu bar gives you all menu items. Toolbar offers shortcuts to menu items Toolbox contains controls and components The form allows you to design visual elements Code window behind form is where you place code Solution Explorer shows all files in your solution IS 118

Summary Properties window shows properties of selected object To develop a program Draw and adjust the controls on the form Set properties of the objects Place code in events, then test and revise The IDE allows you to write and compile the program Use comments in your code to show the purpose of the code Break long code lines with an underscore character IS 118

Summary Objects have three types of interfaces: properties, methods, and events VS.Net help file provides a wealth of information Follow object naming conventions Use predefined prefixes for objects Give objects meaningful names Two types of programming statements: Those that produce results Those that control program flow IS 118

Summary Four types of objects introduced: Form used for visual interface Label used to display text to give clues Button used to trigger actions Timer used to keep track of time IDE automatically produces the executable when you develop the program Run the executable like other Windows programs IS 118