Hands-on Introduction to Visual Basic .NET

Slides:



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

Chapter 1: An Introduction to Visual Basic 2012
© by Pearson Education, Inc. All Rights Reserved.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
Compunet Corporation Programming with Visual Basic.NET GUI Week # 11 Tariq Ibn Aziz.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Introduction to Visual Basic. What is Visual Basic? An environment for developing Windows applications Components –A GUI (Graphical User Interface - gooey)
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
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.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Microsoft Visual Basic 2005: Reloaded Second Edition
An Introduction to Visual Basic
IE 411/511: Visual Programming for Industrial Applications
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT.
Multiple Forms, Container Controls, AddHandler This presentation is based on the Forms and ContainerControls VB Projects 1.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
Integrated Development Environment (IDE)
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
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 INTRODUCTION TO VISUAL BASIC © Prepared By: Razif Razali 1.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
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.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
COMPUTER III. Fundamental Concepts of Programming Control Structures Sequence Selection Iteration Flowchart Construction Introduction to Visual Basic.
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 Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter One An Introduction to Visual Basic 2008.
Dive Into® Visual Basic 2010 Express
Chapter 3: I Need a Tour Guide (Introduction to Visual Basic 2012)
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
Visual Basic Code & No.: CS 218
Chapter Topics 15.1 Graphical User Interfaces
Introduction to Visual Basic 2008 Programming
Chapter 2 – Introduction to the Visual Studio .NET IDE
Program and Graphical User Interface Design
Chapter Eleven Handling Events.
1. Introduction to Visual Basic
Using Procedures and Exception Handling
Microsoft Excel 2003 Illustrated Complete
Chapter 2 Visual Basic Interface
Program and Graphical User Interface Design
Social Media And Global Computing Introduction to Visual Studio
Chapter 2 – Introduction to the Visual Studio .NET IDE
Understanding the Visual IDE
CIS16 Application Development Programming with Visual Basic
Building an Application in the Visual Basic .NET Environment
Chapter 15: GUI Applications & Event-Driven Programming
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Presentation transcript:

Hands-on Introduction to Visual Basic .NET 6 Hands-on Introduction to Visual Basic .NET Programming Right from the Start with Visual Basic .NET 1/e

Objectives Have hands-on experience developing applications with Visual Basic .NET and Visual Studio .NET Understand events and their relationships to the graphical user interface Explain the advantages of objects for developing applications

Objectives (cont.) Understand and effectively use the Button, Label, and PictureBox controls Successfully write Windows applications that modify properties at runtime

6-1 What Is Visual Basic .NET? VB. NET is a modern development language that shares a syntax heritage with the BASIC language. VB. NET maintains Visual Basic’s tradition of excellence as the world’s most widely used tool for developing Windows applications.

6-1 What Is Visual Basic .NET? (cont.) VB. NET was completely redesigned to be highly integrated with Microsoft’s .NET Framework. VB. NET is a full-fledged object-oriented programming language, making it comparable to C++, Java, Delphi, and C# in terms of developing object-oriented systems.

6-2 Using Visual Studio .NET VB .NET applications are developed from within Visual Studio .NET. The development environment contains multiple windows and multiple functionalities and is called an integrated development environment (IDE).

6-2 Using Visual Studio .NET (cont.)

6-2 Using Visual Studio .NET (cont.) The menubar contains File, Edit and Help plus some other options specific to Visual Studio. The standard toolbar gives icon shortcuts for frequently used menu commands. The layout toolbar provides icon shortcuts to commands for formatting layouts of forms and other objects.

6-2 Using Visual Studio .NET (cont.) The middle of the screen is the Designer window, which contains forms being developed. The toolbox located on the left of the screen contains the controls you can add to the form. The Solution Explorer on the top right side of the screen typically contains one project, a references folder, an assembly file, and a form file.

6-2 Using Visual Studio .NET (cont.) The Properties window on the bottom right side of the screen contains three parts: Combo box Properties list Description pane

6-3 Your First VB. NET Program: Hello World Step 1: Add Button to Form

6-3 Your First VB. NET Program: Hello World (cont.) Step 2: Set Properties

6-3 Your First VB. NET Program: Hello World (cont.) Step 3: Add Code The Code Editor is where you enter, display, and edit your code. A comment is a descriptive note added to the code for documentation or explanatory purposes. An event procedure is code that is called in response to an event, such as a mouse click.

6-3 Your First VB. NET Program: Hello World (cont.) Step 3: Add Code (cont.)

6-3 Your First VB. NET Program: Hello World (cont.) Step 4: Run the Project

6-3 Your First VB. NET Program: Hello World (cont.) Step 5: Save the Project

6-4 Windows GUI Visual Basic is the most widely used tool for developing Windows applications. Windows applications utilize a GUI that provides visual cues to the user that allow the user to work intuitively and efficiently. Windows applications contain WYSIWYG “What You See Is What You Get”

6-5 Working with Objects An object is anything we might use in our application for acquiring, manipulating, or presenting data or information. An object contains properties (data) and methods (actions for manipulating an object’s data). An object is defined once as a class.

6-5 Working with Objects (cont.) The developer creates as many instances of the object as necessary for the application. The .NET class library is a large library of classes with reusable code included in the Microsoft .NET Framework. .NET uses namespaces, which are collections of related classes/ System.Windows.Form is the namespace containing classes for creating Window based applications.

Reuse and Reliability One of the most powerful features of object classes is that they are reusable. Objects can enhance reliability, which is the result of good design and lots of testing. Do not reinvent the wheel

6-6 Control Objects The Control class contains numerous properties and methods common to all controls for developing the user interface.

6-6 Control Objects (cont.) The Button control is considered to be the most basic graphical control. The Label control is used to display text that cannot be edited by the user. The PictureBox control is used to display graphics. The Timer control is used to raise an event at user-defined intervals.

6-7 Working with Events Visual Basic supports event-driven programming in which the application recognizes and responds to events. An event is an action or occurrence recognized by some object and for which you can write code to respond. And event handler contains code that responds to a particular event.

Event Procedures The naming convention for an event procedure is the keyword Sub followed by the name of the triggering object followed by an underscore character followed by the name of the event: e.g. Sub frmMain_Click

Rem Statement Rem statements provide an explanatory remark in a program. Header comments occur at the beginning of a project file. Block comments appear above a block of one or more lines of code. Inline comments typically appear on the same line as a statement.

Rnd Statement The Rnd statement generates a single precision random value between 0.0 up to (but not including) 1.0. The Randomize statement is used to change the seed value (random sequence).

6-8 Project Development Process Analysis stage The developer decides what kind of application and features he or she wants. Design stage The developer plans how to achieve the goals of the analysis stage. Implementation stage When the design is finished, the developer begins.

6-8 Project Development Process (cont.) Maintenance stage Corrective maintenance Adaptive maintenance Enhancement maintenance

The Cost of Poor Planning Fixing an analysis problem requires 3 times as much time and effort if not fixed until the design stage, 10 times as much time and effort if not fixed until the implementation stage, and 50 to 100 times if not fixed until the maintenance stage.

Testing and Documentation Testing and documentation are essential activities for each stage of development. Testing at the analysis stage could be a series of “What if…?” questions. There is nothing wrong with adding features and functionality, but the developer should be compensated for the additions.

Chapter Summary Visual Basic is an object-oriented, event-driven language. An object is a self-contained entity that has both properties and methods. Windows forms are objects. Most of the objects you will need are available in VB. NET.

Chapter Summary (cont.) An event refers to an action or occurrence detected by a program. An event procedure is the method that handles an event. The analysis stage determines what the solution needs to do. The design stage determines how the solution will do it.

Chapter Summary (cont.) The implementation stage involves writing code to implement the design. The maintenance stage begins when the product is delivered. Testing and documentation are essential activities of every development stage.

Hands-on Introduction to Visual Basic .NET 6 Hands-on Introduction to Visual Basic .NET Programming Right from the Start with Visual Basic .NET 1/e