Visual Basic.NET Windows Programming

Slides:



Advertisements
Similar presentations
What Was I Thinking??. Key Terms 1. Control 1. Control 2. Design Mode 2. Design Mode 3. Event 3. Event 4. Form 4. Form 5. Interface 5. Interface 6. Properties.
Advertisements

VISUAL BASIC Visual Basic is derived from the Basic language (Beginner’s All-Purpose Symbolic Instruction Code) Visual Basic uses an event-driven programming.
Information System Design Lab 5&6. User Interface Design.
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Chapter 1: An Introduction to Visual Basic 2012
Using Macros and Visual Basic for Applications (VBA) with Excel
Chapter 1: An Introduction to Visual Basic.NET Programming with Microsoft Visual Basic.NET, Second Edition.
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.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
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.
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.
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.
An Introduction to Visual Basic
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
© 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.
1 1 Lab1 Ismail M. Romi – IT Dept, PPU, Visual Basic 2005 Programming Tour.
 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.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Introduction to Programming with RAPTOR
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.
What is Visual Basic.NET? 110 B-1 e.g. a word processor doesn’t do anything until the user clicks on a button, types text... A programming language that.
3.9 to  Also refer to as Program  Contains set of instructions that tells the computer how to perform specific task.  Each line of code is referred.
1.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 4 Working with Variables, Constants, Data Types, and Expressions.
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
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.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
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.
 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.
Programming with Visual Basic.NET. Quick Links Program Code The Code Window The Event Procedure Assignment Statements Using AutoList Radio Buttons Buttons.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
3.02 APPLY PROPERTIES ASSOCIATED WITH THE CONTROLS Computer Programming I.
Dive Into® Visual Basic 2010 Express
Chapter 1: An Introduction to Visual Basic .NET
Excel Tutorial 8 Developing an Excel Application
Visual Basic .NET BASICS
Chapter 2: The Visual Studio .NET Development Environment
Microsoft Visual Basic 2005 BASICS
Chapter 1: An Introduction to Visual Basic 2015
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
1. Introduction to Visual Basic
How to design a Windows Forms application
3.01 Apply Controls Associated With Visual Studio Form
Microsoft Excel 2003 Illustrated Complete
Chapter 2 Visual Basic Interface
Variables and Arithmetic Operations
Exploring Microsoft Excel
Hands-on Introduction to Visual Basic .NET
CIS16 Application Development Programming with Visual Basic
WEB PROGRAMMING JavaScript.
Visual Basic Programming Chapter Four Notes Working with Variables, Constants, Data Types, and Expressions GROUPBOX CONTROL The _____________________________________.
Building an Application in the Visual Basic .NET Environment
Introduction to Programming
Presentation transcript:

Visual Basic.NET Windows Programming Visual Basic.NET is used to create Windows, Web, and command line applications. An application makes the computer a useful tool by enabling the user to perform a task, such as word processing. Buttons, check boxes, and text boxes are common objects in a Windows application.

Object Oriented Programming Language (OOP) Visual Basic.NET language is an object oriented programming language Objects – appear on the screen (buttons, check boxes, ….)

Event-Driven Applications Performing tasks with objects is the basis of an OOP application. A Windows application is event-driven. Event-Driven application – executes code in response to events. Event – can occur when the user interacts with an object, such as clicking a button.

Projects Project – contains all files required to execute an application. Design Window (Form) – displays the application interface where objects are added, deleted, and sized. Toolbox – contains controls that are used to create objects. Solution Explorer Window – is used to switch between the Design and Code Window

Projects continued… Properties Window – lists the properties of a selected object. Properties – defines its appearance, behavior, position, and other attributes.

Windows Form A Windows application interface includes at least one form. A form is a graphical object that contains a title bar, a system menu, and Minimize, Maximize, and Close buttons. A new Visual Basic.NET Windows application automatically includes on Form object.

Windows Form continued… A Form object has properties just like a tool that define its appearance, behavior, position, and other attributes. The Text property of a form defines what is displayed in its title bar. Pressing Enter or clicking outside the Properties window applies the new Text property value to the Form.

Control Objects The Toolbox in Visual Basic.NET contains controls. Control – is used to add objects to a form. Control Objects – display information or get user input.

The Label Control Properties Name – identifies a control for the programmer. It is good programming style to begin Label object names with lbl. Text – is the text displayed in the label. Font – controls the font style and size of the text. Text Alignment – is the alignment of text in a label.

Good Programming Style For most objects, the Name property should always be set to a descriptive name. A proper name begins with the appropriate prefix and then describes the purpose of the object. Following proper naming conventions is GOOD PROGRAMMING STYLE.

Saving an Application After the first time selecting Save from the File menu or clicking on the Save button will save your project. An application should be saved frequently to avoid losing changes.

Running an Application To run an application click the Start button (Play button) on the toolbar or select Start from the Debug menu. To terminate a running application, click the Stop Debugging button or select Stop Debugging from the Debug menu. Running an application means that a program is first converted to a language the computer understands in a process called compiling.

Main Menu Control Prefix for Main Menu: mnu Windows applications typically include menus that contain commands. A menu is modified in the Design window by clicking a MenuItem object and typing a new name.

Program Code Applications contains sets of instructions called program code. Program Code – tells the computer how to perform tasks. Each line of code is called a statement. In Visual Basic.NET some code is automatically generated for a form and the objects on the form.

Event Procedure Procedure - is a block of code written to perform specific tasks. Event Procedure – is a type of procedure that performs tasks in response to user interaction with an object.

Assignment Statements Assignment Statement – used in a procedure to change a value at run time. One use of assignment statements is to set an object property at run time.

Assignment Statements cont… Object.Property = Value Object = the control object name Property = the name of a property for that object Value = is a valid property setting

Assignment Statements cont… A dot(.) is required between Object and Property to access the property. The equal sign (=) assigns the property on the left of the equal sign the value on the rights of the equal sign. Assignment Statements allow a single label to display different text at run time.

AutoList When a dot (.) is typed in a statement, an AutoList of options is displayed. The options displayed in an AutoList depend on what was typed just before the dot. Me is used in the assignment statement so that object names are displayed when a dot is typed. Me refers to the Form object. Selecting from an AutoList can reduce typing errors in code. AutoList is also a good way to choose values in an assignment statement.

RadioButton Control A group of radio buttons is often used in an application to enable the user to choose from a set of options. Name = prefix = rad Text = text displayed next to the button Checked = can be set to either True or False to display the radio button as selected or not.

RadioButton cont… Only one radio button in a group can be checked at any given time. Therefore, changing the Checked value of one button to True automatically changes the other buttons in the group to False. The click event procedure executes when the user clicks a button.

GroupBox A GroupBox is used to group related radio buttons. A GroupBox object must be added to a form before adding RadioButton objects. Radio buttons are then added to the group box by clicking the RadioButton control and the clicking the group box.

GroupBox cont… Dragging a group box moves it and all the controls within it together. Name = prefix = grp Text = is the text displayed at the top of the group box.

Commenting Code Comments are used to explain and clarify program code for other programmers. Comments have no effect on the way an application runs. The single quotation mar (‘) must begin a comment. Anything after the single quotation mark is considered a comment for that line of the program only.

Commenting Code cont… Multiline comments can be created by placing a quotation mark at the beginning of each line. Comments are good programming style and should be used wherever code may be confusing.

Arithmetic Operators Visual Basic.NET includes a set of built-in arithmetic operators for: Exponentiation (^) Multiplication (*) Division (/) Addition (+) Subtraction (-)

Numeric Expressions Arithmetic operators are used to form a numeric expression. A numeric expression is not enclosed in quotation marks because quotation marks indicate text. Since a label displays text, the value is automatically converted to text.

Operator Precedence Visual Basic.NET evaluates a numeric expression using a specific order of operations, or operator precedence. 1. Exponentiation 2. Multiplication and Division 3. Addition and Subtraction

Operator Precedence cont… Two operators of the same precedence, for example + and -, are evaluated in order from left to right. The operators within parentheses are evaluated first. It is good programming style to include parentheses when there is any confusion or question about the numeric expression.

ButtonControl The button is commonly used in Windows application interfaces. Name = prefix = btn Text = is the text displayed on the button A click event procedure is usually coded for a Button object and executes when the user clicks the button.

THE END.