MELJUN CORTES Visual Basic 2005 Introduction
Upcoming SlideShare
Loading in...5
×
 

MELJUN CORTES Visual Basic 2005 Introduction

on

  • 201 views

MELJUN CORTES Visual Basic 2005 Introduction

MELJUN CORTES Visual Basic 2005 Introduction

Statistics

Views

Total Views
201
Slideshare-icon Views on SlideShare
201
Embed Views
0

Actions

Likes
0
Downloads
2
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    MELJUN CORTES Visual Basic 2005 Introduction MELJUN CORTES Visual Basic 2005 Introduction Presentation Transcript

    • Visual Basic 2005 I. INTRODUCTION MELJUN CORTES
    • In this chapter you will learn: • The history of the Visual Basic programming language. • Some basics of object technology. • The brief history of the Internet and the World Wide Web. • The motivation behind and an overview of Microsoft's .NET initiative • To test-drive a Visual Basic 2005 application. Introduction to .NET, Visual Basic and Object Technology Objectives INTRODUCTION Visual Basic 2005 2
    • Introduction to .NET, Visual Basic and Object Technology Visual Basic evolved from BASIC (Beginner's All-Purpose Symbolic Instruction Code) Developed in the mid-1960s by Professors John Kemeny and Thomas Kurtz of Dartmouth College as a language for writing simple programs BASIC's primary purpose was to familiarize novices with programming techniques Visual Basic INTRODUCTION Visual Basic 2005 3
    • Introduction to .NET, Visual Basic and Object Technology The natural evolution of BASIC was Visual Basic, introduced by Microsoft in 1991 Visual Basic makes the development of Windows applications convenient Microsoft announced the introduction of its .NET (pronounced "dot-net") strategy in 2000 Visual Basic INTRODUCTION Visual Basic 2005 4
    • Introduction to .NET, Visual Basic and Object Technology The .NET platform is one over which Webbased applications can be distributed to a variety of devices and to desktop computers The .NET platform enables programs created in different programming languages to communicate easily with each other Visual Basic offers powerful objectoriented programming capabilities Visual Basic INTRODUCTION Visual Basic 2005 5
    • Introduction to .NET, Visual Basic and Object Technology The Internet was originally designed to connect the main computer systems of about a dozen universities and research organizations The Internet has exploded into one of the world's premier communication mechanisms and continues to grow rapidly The Internet and World Wide Web INTRODUCTION Visual Basic 2005 6
    • Introduction to .NET, Visual Basic and Object Technology The World Wide Web allows computer users to locate and view multimediabased documents on almost any subject over the Internet In 1989, Tim Berners-Lee of CERN (the European Organization for Nuclear Research) began to develop a technology for sharing information via hyperlinked text documents The Internet and World Wide Web INTRODUCTION Visual Basic 2005 7
    • Introduction to .NET, Visual Basic and Object Technology In 1994, Tim Berners-Lee founded an organization, called the World Wide Web Consortium(W3C) The W3C (www.w3.org) is also a standardization organization Web technologies standardized by the W3C are called Recommendations Current W3C Recommendations include the Extensible Markup Language(XML) The Internet and World Wide Web INTRODUCTION Visual Basic 2005 8
    • Introduction to .NET, Visual Basic and Object Technology In 2000, Microsoft announced its .NET initiative A new vision for embracing the Internet and the Web in the development and use of software One key aspect of .NET is its independence from a specific language or platform Microsoft’s .NET INTRODUCTION Visual Basic 2005 9
    • Introduction to .NET, Visual Basic and Object Technology The .NET architecture can exist on multiple platforms, not just Microsoft Windows based systems A key component of the .NET architecture is Web services The .NET strategy extends the concept of software reuse to the Internet Microsoft’s .NET INTRODUCTION Visual Basic 2005 10
    • Introduction to .NET, Visual Basic and Object Technology The Microsoft .NET Framework is at the heart of the .NET strategy This framework manages and executes applications and Web services, contains a class library (called the .NET Framework. Class Library, or FCL), enforces security and provides many other programming capabilities The .NET Framework and the Common Language Runtime INTRODUCTION Visual Basic 2005 11
    • Introduction to .NET, Visual Basic and Object Technology The details of the .NET Framework are found in the Common Language Infrastructure (CLI) The .NET Framework and the Common Language Runtime INTRODUCTION Visual Basic 2005 12
    • Introduction to .NET, Visual Basic and Object Technology The Common Language Runtime (CLR) is another central part of the .NET Framework - it executes .NET programs Programs are compiled into machinespecific instructions in two steps: ◦ First, the program is compiled into Microsoft Intermediate Language (MSIL), which defines instructions for the CLR ◦ Second, the MSIL for an application's components is placed into the application's executable file The .NET Framework and the Common Language Runtime INTRODUCTION Visual Basic 2005 13
    • Introduction to .NET, Visual Basic and Object Technology The ability of a program to run (without modification) across multiple platforms is known as platform independence The .NET Framework also provides a high level of language interoperability The .NET Framework Class Library FCL contains a variety of reusable components, saving programmers the trouble of creating new components The .NET Framework and the Common Language Runtime INTRODUCTION Visual Basic 2005 14
    • Introduction to .NET, Visual Basic and Object Technology Test-Driving a Visual Basic Application INTRODUCTION Visual Basic 2005 15
    • In this chapter you will learn: •The basics of the Visual Studio Integrated Development Environment (IDE) that assists you in writing, running and debugging your Visual Basic programs. •Visual Studio's help features. •Key commands contained in the IDE's menus and toolbars. •The purpose of the various kinds of windows in the Visual Studio 2005 IDE. •What visual programming is and how it simplifies and speeds program development. •To create, compile and execute a simple Visual Basic program that displays text and an image using the Visual Studio IDE and the technique of visual programming. Introduction to the Visual Basic 2005 IDE Objectives INTRODUCTION Visual Basic 2005 16
    • Introduction to the Visual Basic 2005 IDE There are many versions of Visual Studio available ◦ ◦ ◦ ◦ ◦ ◦ ◦ Visual Visual Visual Visual Visual Visual Visual Studio Studio Studio Studio Studio Studio Studio 97 6.0 .NET 2002 .NET 2003 2005 2008 express editions Overview of the Visual Studio 2005 IDE INTRODUCTION Visual Basic 2005 17
    • Introduction to the Visual Basic 2005 IDE New Project button Start Page tab Toolbox Empty Solution Explorer Start Page links Overview of the Visual Studio 2005 IDE INTRODUCTION Visual Basic 2005 18
    • Introduction to the Visual Basic 2005 IDE New Project dialog Visual Basic Windows Application (selected) Default project name Description of selected project Overview of the Visual Studio 2005 IDE INTRODUCTION Visual Basic 2005 19
    • Introduction to the Visual Basic 2005 IDE Design view of the IDE Active tab Tabs Menu Menu bar Solution explorer Form design (Windows Application) Properties window Overview of the Visual Studio 2005 IDE INTRODUCTION Visual Basic 2005 20
    • Introduction to the Visual Basic 2005 IDE Dialog for modifying a control's font properties Font dialog window Overview of the Visual Studio 2005 IDE INTRODUCTION Visual Basic 2005 21
    • Introduction to the Visual Basic 2005 IDE Commands for managing the IDE and for developing, maintaining and executing programs are contained in menus The set of menus displayed depends on what you are currently doing in the IDE Menu bar Menu Bar and Toolbar INTRODUCTION Visual Basic 2005 22
    • Introduction to the Visual Basic 2005 IDE Menu Description File Contains commands for opening, closing, adding and saving projects, as well as printing project data and exiting Visual Studio. Edit Contains commands for editing programs, such as cut, copy, paste, undo, redo, delete, find and select. View Contains commands for displaying windows (e.g., Solution Explorer, Toolbox, Properties window) and for adding toolbars to the IDE. Project Contains commands for managing projects and their files. Build Contains commands for compiling programs. Debug Contains commands for debugging (i.e., identifying and correcting problems in programs) and running programs. Data Contains commands for interacting with databases (i.e., organized collections of data stored on computers). Format Contains commands for arranging and modifying a form's controls. Note that the Format menu appears only when a GUI component is selected in Design view. Continued…… Menu Bar and Toolbar INTRODUCTION Visual Basic 2005 23
    • Introduction to the Visual Basic 2005 IDE Menu Description Tools Contains commands for accessing additional IDE tools (e.g., the Toolbox) and options that enable customization of the IDE. Window Contains commands for arranging and displaying windows. Community Contains commands for sending questions directly to Microsoft, checking question status, sending feedback on Visual Basic and searching the Code-Zone developer center and the Microsoft developers community site. Help Contains commands for accessing the IDE's help features. Menu Bar and Toolbar INTRODUCTION Visual Basic 2005 24
    • Introduction to the Visual Basic 2005 IDE Standard New project Open file Save all Visual Studio toolbar Copy Undo Navigate backward Start debugging Solution configuration Solution platform Command window Start page Add new item Save Cut Paste Redo Navigate forward Toolbox Find in files Find Object browser Properties window Solution explorer Menu Bar and Toolbar INTRODUCTION Visual Basic 2005 25
    • Introduction to the Visual Basic 2005 IDE The IDE provides windows for accessing project files and customizing controls In this section, we introduce several windows that you will use frequently when developing Visual Basic programs These windows can be accessed via the toolbar icons or by selecting the name of the desired window in the View menu Navigating the Visual Studio IDE INTRODUCTION Visual Basic 2005 26
    • Introduction to the Visual Basic 2005 IDE Toolbar icons for Visual Studio windows Solution Explorer Object Browser Properties Window Toolbox Navigating the Visual Studio IDE INTRODUCTION Visual Basic 2005 27
    • Introduction to the Visual Basic 2005 IDE Auto-hide feature Icon for Hidden Window Navigating the Visual Studio IDE INTRODUCTION Visual Basic 2005 28
    • Introduction to the Visual Basic 2005 IDE Auto-hide feature Window is shown when the window icon is clicked Navigating the Visual Studio IDE INTRODUCTION Visual Basic 2005 29
    • Introduction to the Visual Basic 2005 IDE The Solution Explorer ◦ The Solution Explorer window provides access to all of the files in a solution Toolbar Startup Project Navigating the Visual Studio IDE INTRODUCTION Visual Basic 2005 30
    • Introduction to the Visual Basic 2005 IDE The Solution Explorer ◦ Solution Explorer showing plus boxes and minus boxes for expanding and collapsing the tree to reveal or hide project files Plus box Minus box Navigating the Visual Studio IDE INTRODUCTION Visual Basic 2005 31
    • Introduction to the Visual Basic 2005 IDE The Toolbox ◦ The Toolbox contains icons representing controls used to customize forms Group names Controls ... Navigating the Visual Studio IDE INTRODUCTION Visual Basic 2005 32
    • Introduction to the Visual Basic 2005 IDE The Properties Window ◦ The Properties window displays the properties for the currently selected Form, control or file in design view Categorized icon Alphabetic icon Component selection drop-down list Toolbar Properties Property values Description Navigating the Visual Studio IDE INTRODUCTION Visual Basic 2005 33
    • Introduction to the Visual Basic 2005 IDE Visual Studio provides extensive help features Command Description How Do I? Contains links to relevant topics, including how to upgrade programs and learn more about Web services, architecture and design, files and I/O, data, debugging and more. Search Finds help articles based on search keywords. Index Displays an alphabetized list of topics you can browse. Contents Displays a categorized table of contents in which help articles are organized by topic. Using Help INTRODUCTION Visual Basic 2005 34
    • Introduction to the Visual Basic 2005 IDE Dynamic help is an excellent way to get information quickly about the IDE and its features Dynamic help window Using Help INTRODUCTION Visual Basic 2005 35
    • Introduction to the Visual Basic 2005 IDE Using Help INTRODUCTION Visual Basic 2005 36
    • Introduction to the Visual Basic 2005 IDE Using Visual Programming to Create a Simple Program INTRODUCTION Visual Basic 2005 37
    • In this chapter you will learn: •To write simple Visual Basic programs using code rather than visual programming. •To write statements that input data from the keyboard and output data to the screen. •To declare and use data of various types. •To store and retrieve data from memory. •To use arithmetic operators to perform calculations. •To use the precedence of arithmetic operators to determine the order in which operators are applied. •To write decision-making statements. •To use equality and relational operators to compare operands. •To use message dialogs to display messages. Introduction to Visual Basic Programming Objectives INTRODUCTION Visual Basic 2005 38
    • Introduction to the Visual Basic Programming In this chapter, we introduce Visual Basic programming with program code and present examples to demonstrate how programs can display messages and obtain information from the user at the keyboard for processing Overview INTRODUCTION Visual Basic 2005 39
    • Introduction to the Visual Basic Programming Simple Visual Basic Program Displaying a Line of Text INTRODUCTION Visual Basic 2005 40
    • Introduction to the Visual Basic Programming Creating the console application Ensure that Console Application is selected Type the project name Click Ok to create A new project Creating A Console Application in Visual Basic 2005 INTRODUCTION Visual Basic 2005 41
    • Introduction to the Visual Basic Programming IDE with an open console application Code or editor window Creating A Console Application in Visual Basic 2005 INTRODUCTION Visual Basic 2005 42
    • Introduction to the Visual Basic Programming Changing the name of the program file Click Module1.vb to display its properties File Name property (file name can be changed here) Creating A Console Application in Visual Basic 2005 INTRODUCTION Visual Basic 2005 43
    • Introduction to the Visual Basic Programming Setting up the startup object Change the startup object by selecting from Startup Object drop-down list Creating A Console Application in Visual Basic 2005 INTRODUCTION Visual Basic 2005 44
    • Introduction to the Visual Basic Programming IntelliSense feature of Visual Studio Partially-typed member Member list Highlighted member Creating A Console Application in Visual Basic 2005 INTRODUCTION Visual Basic 2005 45
    • Introduction to the Visual Basic Programming Writing Another Sample Program INTRODUCTION Visual Basic 2005 46
    • Introduction to the Visual Basic Programming The arithmetic operators are summarized below: VB Operation Arithmetic Operator Algebraic Expression VB Expression Addition + f+7 f+7 Subtraction - p–c p–c Multiplication * bm b*m Division (floating point) / x/y or x÷y x/y Division (integer) none vu Mod r mod s r Mod s Exponentiation ^ qp q^p Unary minus - -e -e Unary plus + +g +g Modulus Arithmetic INTRODUCTION Visual Basic 2005 47
    • Introduction to the Visual Basic Programming Precedence of arithmetic operators Operator(s) Operation Order of evaluation (precedence) ^ Exponentiation Evaluated first. If there are several such operators, they are evaluated from left to right. +,- Sign operations Evaluated second. If there are several such operators, they are evaluated from left to right. *,/ Multiplication and Division Evaluated third. If there are several such operators, they are evaluated from left to right. Integer division Evaluated fourth. If there are several such operators, they are evaluated from left to right. Mod Modulus Evaluated fifth. If there are several such operators, they are evaluated from left to right. +,- Addition and Subtraction Evaluated sixth. If there are several such operators, they are evaluated from left to right. Arithmetic INTRODUCTION Visual Basic 2005 48
    • Introduction to the Visual Basic Programming Equality and relational operators Standard algebraic equality operator or relational operator VB equality or relational operator Example of VB condition Meaning of VB condition = = x=y ≠ <> x <> y x is not equal to y > > x>y x is greater than y < < x<y x is less than y ≥ >= x >= y x is greater than or equal to y ≤ <= x <= y x is less than or equal to y Equality operators x is equal to y Relational operators Equality and Relational Operators INTRODUCTION Visual Basic 2005 49
    • Introduction to the Visual Basic Programming Visual Basic programs often use message dialog windows to display output Visual Basic provides class MessageBox for creating message dialogs Using a Message Dialog to Display a Message INTRODUCTION Visual Basic 2005 50
    • Introduction to the Visual Basic Programming Displaying text in a message dialog Using a Message Dialog to Display a Message INTRODUCTION Visual Basic 2005 51
    • Introduction to the Visual Basic Programming Displaying text in a message dialog Using a Message Dialog to Display a Message INTRODUCTION Visual Basic 2005 52
    • Introduction to the Visual Basic Programming End of Introduction INTRODUCTION Visual Basic 2005 53