Getting Started with VB .NET

Slides:



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

Tutorial 12: Enhancing Excel with Visual Basic for Applications
© 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,
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
Using Visual Basic 6.0 to Create Web-Based Database Applications
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
Using the Visual Basic Editor Visual Basic for Applications 1.
Compunet Corporation Programming with Visual Basic.NET GUI Week # 11 Tariq Ibn Aziz.
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.
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.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
A First Program Using C#
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Microsoft Visual Basic 2005: Reloaded Second Edition
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
Using Visual Basic 6.0 to Create Web-Based Database Applications
IE 411/511: Visual Programming for Industrial Applications
Chapter 3 Introducing Visual Basic.NET. 3.1 Visual Basic.NET Windows Programming -Used to create Windows, Web, and Console applications -Uses predefined.
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 2 The Visual Basic.NET Integrated Development Environment.
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.
Lecture Set 1 Part C: Understanding Visual Studio and.NET – Applications, Solutions, Projects (no longer used – embedded in Lecture Set 2A)
Copyright © 2001 by Wiley. All rights reserved. Chapter 2: Using Visual Basic to Create a First Project Getting Started with VB Development Environment.
Introduction to the Visual Studio.NET IDE (LAB 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.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
OCC Network Drives  H:\  P:\ 
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
Chapter Two Creating a First Project in Visual Basic.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Visual Basic CDA College Limassol Campus Lecture:Pelekanou Olga Semester C Week - 1.
1.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
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.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
 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.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
2-1 Chapter 2 Using VB.NET to Create a First Solution.
Programming with Microsoft Visual Basic 2012 Chapter 1: An Introduction to Visual Basic 2012.
Dive Into® Visual Basic 2010 Express
Chapter 2: The Visual Studio .NET Development Environment
Chapter 1: An Introduction to Visual Basic 2015
Chapter 2 – Introduction to the Visual Studio .NET IDE
1. Introduction to Visual Basic
3.01 Apply Controls Associated With Visual Studio Form
Chapter 2 – Introduction to the Visual Studio .NET IDE
CIS16 Application Development Programming with Visual Basic
Building an Application in the Visual Basic .NET Environment
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Presentation transcript:

Getting Started with VB .NET Chapter 1 Getting Started with VB .NET

Objectives Learn about VB .NET and the characteristics of a VB .NET solution Start and configure VB .NET Explore the elements of the development environment Learn how to access Help Open a VB .NET solution Explore the tool windows and operating modes of VB .NET

Introducing Visual Studio .NET Visual Studio .NET is an integrated development environment Development environment supports three different languages Visual Basic Visual C++ C# (pronounced C sharp) New to Visual Studio .NET Note that Visual Interdev is obsolete. Functionality included with other Visual Studio .NET products

Introducing Visual Studio.NET Applications (called solutions) developed using a developer interface called the Microsoft Development Environment (MDE) VB .NET supports different types of applications created with the following tools Windows Forms used to create desktop applications Web Forms used to create programmable Web pages Web Services process client – server requests

? Programming Languages Programming language are made up of words forming statements A Statement expresses a complete thought or idea Similar to an English sentence Statements grouped into procedures A procedure is similar to a paragraph in English Procedures grouped into a module Modules contain one or more procedures Modules correspond to physical disk files Module files have the suffix .vb.

? Programming Languages A program contains statements, grouped into procedures, in one or more modules VB .NET calls a program a solution Each solution is stored in its own folder Solution folder contains sub folder Solution folder contains all of the files that make up the solution

Program Relationships Public Class frmMain Inherits System.Windows.Forms.Form Private components = New System.ComponentModel.Container End Class Module file frmMain.vb Public Sub New() End Sub Procedure MyBase.New() InitializeComponent() Executable statements Public Sub InitializeComponent() End Sub Procedure Me.Text = "Chapter 1 – Completed Example Executable statement Public Class frmDialog . . . End Class Module file frmDialog.vb

Types of Statements Declaration statements define the names of data and procedures The following statements declare a variable and a procedure Private mstrCustomerName As String Private Sub InitializeComponent() End Sub Executable statements perform a specific action The following statement closes the form named frmMain frmMain.Close()

Syntax Programming statements adhere to rules known as syntax Statements must be exactly correct VB .NET cannot interpret statements with typographical or spelling errors Incorrect statements will cause a syntax error Syntax errors occur when a statement violates the rules of the language Private mstrCustomerName As Strung frmMain.Closed()

VB .NET Programming Concepts VB .NET solutions have the same characteristics as other programs Window is a rectangular area on the desktop Win Form (form) contains buttons and textboxes Buttons, textboxes, and the form itself are all objects Solutions contain 1 or more forms Collection of forms, buttons, and textboxes form the user interface User interface represents what the user sees and how the user interacts with the solution

Object Oriented Terms Information hiding – Expose only essential information and hide inner logic Encapsulation – Integrate (package) data and processes that act on data together Inner logic is hidden from the developer Inheritance – Create new objects from existing objects Inherit one form from another form Polymorphism – Multiple procedures of the same name perform different tasks Capable of taking many forms

Object Oriented Terms Programming object mimics the behavior of a real-world object Buttons on a form perform a task when clicked Some objects are visible to the user – others are not Objects are created from classes Multiple objects can be created from the same class. For example, create multiple buttons on a form A class is a blueprint (template) for an object Buttons on a form created from the Button class TextBoxes created from the TextBox class

Internal View of a VB .NET Solution An object has: Predefined behaviors or settings called properties Properties exist to define the size and position of a button on a form, for example They are like adjectives they describe the object Methods represent the actions an object can perform They are like verbs they perform an action Events allow messages to be sent to a solution Write code in event handlers also known as event procedures When the user clicks a button, statement in the corresponding event handler execute

Internal View of a VB .NET Solution We use controls to create objects on a form A control created on a form is called a control instance Button control is a button the user can click Label control displays text but cannot receive input OpenFileDialog control displays a standard dialog box allowing user to select a file PictureBox control displays pictures All control instances are created from their respective class

Sample of VB .NET Controls Label control instance to display file name Label control instance to display a descriptive prompt PictureBox control instance to display graphical image Buttons when clicked perform an action OpenFileDialog control instance has no visual interface and appears in a tray at the bottom of the form

Starting VB .NET Microsoft Visual Studio.NET 7.0 Start button

Configuring VB .NET VB .NET supports two operating modes Tabbed documents environment Docked windows appear along edge of the MDE (?) Docked windows can be temporarily hidden Floating windows appear anywhere on the desktop Windows can be autohidden along any edge of the MDE Multiple document interface Appearance similar to Excel

Configuring VB .NET On the Menu bar, click Tools, and then click Options to display Options dialog box General tab sets environment (tabbed documents or MDI mode) Projects and Solutions tab sets default folder for projects and when changes are saved

VB .NET Options Dialog Box – General Tab Select folder Active page highlighted

VB .NET Options Dialog Box – Projects and Solutions Tab Default project location

VB .NET Window Types Document window Docked window Autohidden window Floating window

Configuring the Menu Bar and Toolbar Multiple regions display toolbars Regions appear along any edge of the MDE Individual toolbars can be hidden or made visible depending on task at hand Use Customize dialog to configure toolbars Floating toolbars appear anywhere on the desktop Docked toolbars anchored along any edge of the MDE Usually they appear below the menu bar

Docked and Floating Toolbars Docked toolbar Floating toolbar Toolbars docked along bottom of MDE

Document Windows Appear on group tabs and correspond to the individual files that make up a solution Win Form Designer used to create the user interface Code Editor used to write statements in event handlers Only one document window visible at a time Select window on group tab to activate desired document window Buttons to the right of a group tab navigate between document windows and close them

Tool Windows The same tool windows are used in the creation of all VB .NET solutions Solution Explorer groups all elements needed to build and run a solution Properties window allows developer to manage the appearance of each object Help windows are also tool windows Tool windows can be: Docked – appearing along an edge of the MDE Autohidden – hidden along an edge of the MDE Floating – appearing anywhere on the desktop

Document Windows & Tool Windows Document windows appear on tab group Close active document window Solution Explorer is a tool window (appearing as a docked window

Configuring Tool Windows Make a window float by right-clicking on the title bar and select Floating Autohide a window by first docking the window. Right-click the title bar and select Autohide Dock a window by right-clicking the title bar and select dockable. Drag the window to an edge of the MDE Configure windows as desired so that they best fit your needs

Configuring Tool Windows Docked window Autohidden windows appear along an edge of the MDE

Getting Help VB .NET supports four primary help windows Index – alphabetical list of contents Contents – table of contents organized by topic Search – locate topics by keyword Dynamic Help – new to .NET Display topics based on active window and current task Topics that appear in the Dynamic Help window will change as you navigate from window to window Help filters restrict information displayed

Help – Index Index tab Filter applied Applicable topics

Help – Contents Book expanded Topic

Help – Search Search text Search results

Help – Dynamic Help Dynamic Help Window

Opening a VB .NET Solution Click File, and then click Open Solution Select folder Enter solution name Click to Open solution

Organization of a VB .NET Solution Solution file is at the heart of the application Controls how solution will be translated into executable file Controls how application will be distributed File suffix is .sln Solution file references one or more project files which: Store global information List the other files in the project List references to namespaces

Form Modules Projects can contain multiple forms Each form stored in a form module Form module contains code to create control instances Also contains code written by the developer to perform tasks File suffix is .vb Do not change file suffix or VB .NET will not be able to locate files

Elements of a Solution solution file form module frmDialog.vb form module frmMain.vb class module clsDemo.vb project file Complete01.vbproj standard module stdDemo.vb Bin folder contains compiled solution Obj folder contains temporary files text file solution items icon files miscellaneous files

The Solution Explorer Groups projects and modules comprising a solution

Properties Window Property is a characteristic of an object Color, caption, screen location Set properties using the Properties window Name column lists property Value column contains current value Display properties alphabetically or by category Description of selected appears at the bottom of the window Description section may be hidden

Selected Font property has subproperties Properties Window (2) Object list box Toolbar area Selected Font property has subproperties Description area

Visual controls appear in the Toolbox

Operating Modes Three operating modes In run mode VB .NET is executing the program Program appears as the user will see it In design mode you assume the role of the developer In break mode solution is temporarily suspended Use for debugging Refer to Appendix A for information on debugging

Running a Solution Press Start button on the Debug toolbar Solution runs as the user will see it Press Stop Debugging button on the Debug toolbar to end the solution and return to design mode