Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.

Slides:



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

CS0004: Introduction to Programming Visual Studio 2010 and Controls.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
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.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
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.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
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.
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.
Visual Basic Chapter 1 Mr. Wangler.
05/09/ Introducing Visual Basic Sequence Programming.
Hello World In C++ and Microsoft Visual C++. Directions to begin a project 1. Go to All Programs 2. Open Visual Studio C++ 3. Click on New Project 4.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
An Introduction to Visual Basic
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.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
1 1 Lab1 Ismail M. Romi – IT Dept, PPU, Visual Basic 2005 Programming Tour.
Chapter 3: Using GUI Objects and the Visual Studio IDE.
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.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Chapter 3 Introducing Visual Basic
 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.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
Chapter 2 – Introduction to the Visual Studio .NET IDE
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
CSC 157 (Blum)1 Hello World. CSC 157 (Blum)2 Start/Programs/Microsoft Visual Studio.NET 2003/Microsoft Visual Studio.NET 2003.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
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.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
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.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
 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.
Programming with Visual Basic.NET. Quick Links Program Code The Code Window The Event Procedure Assignment Statements Using AutoList Radio Buttons Buttons.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Dive Into® Visual Basic 2010 Express
Visual Basic.NET Windows Programming
Chapter 2: The Visual Studio .NET Development Environment
Introduction to Computer CC111
Chapter Topics 15.1 Graphical User Interfaces
Chapter 2 – Introduction to the Visual Studio .NET IDE
An Introduction to Computers and Visual Basic
3.01 Apply Controls Associated With Visual Studio Form
Program and Graphical User Interface Design
1. Introduction to Visual Basic
3.01 Apply Controls Associated With Visual Studio Form
An Introduction to Computers and Visual Basic
Chapter 2 Visual Basic Interface
Chapter 2 – Introduction to the Visual Studio .NET IDE
CIS16 Application Development Programming with Visual Basic
An Introduction to Computers and Visual Basic
Chapter 15: GUI Applications & Event-Driven Programming
Presentation transcript:

Introduction to Visual Basic

Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and Running an Application Opening and Closing a Project

Intro to Visual Basic An application contains program code which are instructions that tell a computer how to perform a specific task Each line of code is called a statement Most programs you use contain millions of statements and are usually written by teams of programmers VB writes a lot of code for you! This code generates the initial form and sets the default properties of the form. Program Code

Intro to Visual Basic Program Code Cont’d Also, when you draw in a control object in the design window, such as a button, VB generates code automatically to create that object; the code for the object’s functionality is left to you You can get to the code window by using the Solution Explorer Window or by double clicking any object in the form, including the form itself

Intro to Visual Basic Visual Basic Facts BASIC is actually an acronym and stands for Beginner's All-purpose Symbolic Instruction Code BASIC is an old programming language; the “Visual” part has been added recently to make it easier to create powerful windows applications

Intro to Visual Basic Event-Driven Application A Visual Basic application is event driven An event occurs when the user interacts with the application. For example, when a user clicks a button, this is an event

Intro to Visual Basic Event Driven Application Con’t An event-driven application waits for an event to occur before executing code When an event occurs, only the code written to handle that event is run For example, in the simple program below, when the ‘Exit’ button is pressed, the code for that button is executed. If the code is properly written, pressing the button should close the program

Intro to Visual Basic Visual Basic Interface The Visual Basic interface consists of two parts: a graphical interface (“Visual”) and the program code (“BASIC”) graphical interface (“Visual”) program code (“BASIC”)

Becoming Familiar with Visual Basic.NET

Intro to Visual Basic Creating a New Project Click on File>New>Project to bring about the New Project Dialog Box as seen below

Intro to Visual Basic Properties Window The Design Window Toolbox Solution Explorer Window Design Window

Intro to Visual Basic The Design Window Con’t The Design window displays the application interface where objects are added, deleted, and sized The Toolbox contains controls that are used to create objects The Solution Explorer window is used to switch between the Design and Code windows The Properties window lists the properties of a selected object

Intro to Visual Basic The Windows Form A windows application uses at least one form A form is where you design your user interface and put controls such as buttons and textboxes A form can be resized by using the control handles A form has properties that define its appearance and behavior

Intro to Visual Basic Form Properties We can change the properties of our form by selecting the form (click on it) and changing whatever property we want in the Properties Window

Intro to Visual Basic Control Objects Control objects are objects that we can place on our form to create a user interface An user interface is a way of getting input from the user and providing output to the user Some control objects are meant to get user input such as a textbox; other objects are used for output such as labels

Intro to Visual Basic The Label Control Object The label control displays text that cannot be changed by the user The label control is used as an output to display messages to the user Label

Intro to Visual Basic Creating a Label Control Click on the Label control in the toolbox When you place the cursor over the form, the cursor changes Click and drag to draw the label The grid on the form is used to help you create your interface, but does not show up in the final program

Intro to Visual Basic Label Properties The label control has the properties Name identifies the label for you as the programmer; the user never sees this name Text is the message you wish to display to the user Font allows you to change the appearance and font settings of the message you display to the user TextAlign allows you to set the alignment of text in a label. For example, TopLeft, TopCenter…

Intro to Visual Basic Setting Label Properties

Intro to Visual Basic Just to Give You an Idea labels can be used in conjunction with textboxes to get input from the user

Intro to Visual Basic The MainMenu Control A Windows application usually includes menus that contain commands A menu is added to an interface by clicking the MainMenu control in the toolbox and then clicking on the form A menu is automatically added to the interface and a MainMenu component is added to the component tray at the bottom of the Design Window

Intro to Visual Basic Working with MainMenus Click where it says, “Type Here” on the menu in the form to enter commands such as ‘File’, ‘Edit’ When a command or menu name is typed, another box is automatically added to allow for more commands and menus Only the command and menu names that were typed by you will show up at run-time

Intro to Visual Basic MainMenu Properties Name identifies the menu and commands for you as the programmer; the user never sees this name Text is the menu or command name and is set by clicking on the ‘Type Here’ text on the menus in the design window

Intro to Visual Basic Saving and Running an Application Save your work often during development to avoid losing changes To run your program, which you should do often to test what you’ve done, click on the ‘Start’ button If your program has no errors, pressing this button should run your program. Now you can see and use your program as a user would see and use it. You can test its functionality by interacting with it the way you intend a user to interact with it

Intro to Visual Basic Saving and Running an Application Con’t To return to the design window to continue development, simple close the running program (click the ‘x’ in the top right corner of your application)

Intro to Visual Basic What is Really Happening? What really happens when you click the ‘Play’ button? First, the code that you, the programmer writes, is converted into a language that the computer understands in a process called compiling During the compiling process, your program code is checked for syntax errors If there are no syntax errors in your code, VB.NET then builds your application More on all this later…

Intro to Visual Basic Closing and Opening a Project To save your work, click File>Save.vb To close a project, click File>Close Solution To open a project, click File>Open>Project. Then Navigate to find your project in the Open Project Dialog Box.