Tutorial 1: An Introduction to Visual Basic.NET1 Tutorial 1 An Introduction to Visual Basic.NET.

Slides:



Advertisements
Similar presentations
Chapter 1: An Introduction to Visual Basic 2012
Advertisements

Using Macros and Visual Basic for Applications (VBA) with Excel
Chapter 2 –Visual Basic, Controls, and Events
1.
Chapter 1: An Introduction to Visual Basic.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Using the Visual Basic Editor Visual Basic for Applications 1.
Chapter 31 Visual Basic Controls A Form is a windows-style screen displayed by Visual Basic programs. In a form, a programmer can create objects in a form.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Microsoft Visual Basic 2010: Reloaded Fourth 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.
Chapter 2 –Visual Basic, Controls, and Events
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.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Laboratory Exercise # 13 – Font and Number Format Styles Office Productivity Tools 1 Laboratory Exercise # 13 Font and Number Format Styles Objectives:
Tutorial 7: Sub and Function Procedures1 Tutorial 7 Sub and Function Procedures.
Tutorial 7: Sub and Function Procedures1 Tutorial 7 Sub and Function Procedures.
Visual Basic Chapter 1 Mr. Wangler.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Microsoft Visual Basic 2005: Reloaded Second Edition
© 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.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 2 Creating a User Interface.
Starting Out with Visual Basic.NET 2 nd Edition Chapter 2 Creating Applications With Visual Basic.NET.
Introduction to Visual Basic.NET Chapter 2 Introduction to Controls, Events.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Introduction to Visual Basic.NET Your First Visual Basic.NET Application.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
OCC Network Drives  H:\  P:\ 
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Chapter Two Designing Applications Programming with Microsoft Visual Basic th Edition.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 15 Advanced Tables.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
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.
Chapter 3 - VB.NET by Schneider1 Chapter 3 – Fundamentals of Programming in VB.NET Part I VB.NET Controls VB.NET Events.
1.
Lesson: 2 Common Features and Commands After completing this lesson, you will be able to: Identify the main components of the user interface. Identify.
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.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
Creating Menus Menu Bar – behaves like standard Windows menus Can be used in place of or in addition to buttons to execute a procedure Menu items are controls.
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.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Tutorial 1: An Introduction to Visual Basic.NET1 Tutorial 1 An Introduction to Visual Basic.NET.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
Visual Basic.NET Programming for the Rest of Us Keith Mulbery Utah Valley State College.
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 - VB 2008 by Schneider1 Chapter 2 –Visual Basic, Controls, and Events 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual.
Programming with Microsoft Visual Basic 2012 Chapter 1: An Introduction to Visual Basic 2012.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter One An Introduction to Visual Basic 2008.
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
Microsoft Visual Basic 2005: Reloaded Second Edition
Chapter 1: An Introduction to Visual Basic 2012
Chapter 1: An Introduction to Visual Basic 2015
Programming with Microsoft Visual Basic th Edition
Chapter 1: An Introduction to Visual Basic 2015
Chapter 2 – Introduction to the Visual Studio .NET IDE
CIS16 Application Development Programming with Visual Basic
Presentation transcript:

Tutorial 1: An Introduction to Visual Basic.NET1 Tutorial 1 An Introduction to Visual Basic.NET

Tutorial 1: An Introduction to Visual Basic.NET2 Working with Controls Lesson B Objectives After completing this lesson, you will be able to:  Add a control to a form  Set the properties of a label, picture box, and button control  Select multiple controls  Center controls on the form  Set the properties of a project  Start and end an application  Enter code in the Code Editor window  Terminate an application using the Me.Close method

Tutorial 1: An Introduction to Visual Basic.NET3 Working With Controls Toolbox ItemDescription DataComponents to access data and data sources ComponentsComponents to perform special tasks Clipboard RingStores items that you have copied GeneralCan be used to store code snippets Windows FormsObjects used to create user interface

Tutorial 1: An Introduction to Visual Basic.NET4 The Windows Form Tab The Windows Form tab  Contains the 47 basic tools used to design your user interface  You can add new tools or delete existing tools by right- clicking the tab and then clicking Customize Toolbox on the context menu  By default, the tools on the Windows Form tab are listed in order by their estimated frequency of use, but you can right-click to change this to alphabetic listing

Tutorial 1: An Introduction to Visual Basic.NET5 Using the Label Tool  The purpose of a label control is to display text that the user is not allowed to edit while the application is running PropertyDescription NameIdentifies the object in code TextDisplayed information AutoSizeDetermines if the object resizes itself to display all Text LocationSets the X and Y coordinates for where label is displayed FontCharacteristics of the displayed Text

Tutorial 1: An Introduction to Visual Basic.NET6 Key Form Properties PropertyDescription NameUsed to refer to the object TextCaption displayed in the title bar StartPositionPosition of window on screen BackgroundImageImage displayed on the form SizeWidth and Height of window LocationLeft and Top position of window

Tutorial 1: An Introduction to Visual Basic.NET7 Fonts  The Font property allows you to change the type of font used to display the text in the object, as well as the style and size of the font  Type: Courier, Tahoma, and Microsoft Sans Serif  Style: regular, bold, and italic  Size: The numbers 8, 10, and 18 are examples of font sizes  You can change properties on multiple controls (ex. font size) at the same time by clicking one control and then pressing and holding down the Control key as you click the other control in the form

Tutorial 1: An Introduction to Visual Basic.NET8 Using the Format Menu  The Format menu provides options that allow you to manipulate the controls in the user interface  The Align option allows you to align two or more controls by their left, right, top, or bottom borders  You can use the Make Same Size option to make two or more controls the same width or height, or both width and height  The Center in Form option that centers one or more controls either horizontally or vertically on the form

Tutorial 1: An Introduction to Visual Basic.NET9 Using the PictureBox Tool  You can include a logo by displaying the logo in a picture box control, which you create using the PictureBox tool

Tutorial 1: An Introduction to Visual Basic.NET10 Using the Button Tool – Exit Button  Every Windows application should give the user a way to exit the program  Most Windows applications provide either an Exit option on a File menu or an Exit button for this purpose

Tutorial 1: An Introduction to Visual Basic.NET11 Starting and Ending an Application  You can start an application by Clicking Debug on the menu bar, and then clicking Start or you can simply press the F5 key on your keyboard  When you start an application, Visual Studio.NET automatically creates an.exe file which can be run outside of the Visual Studio.NET environment

Tutorial 1: An Introduction to Visual Basic.NET12 Visual Basic.NET Code – Classes & Events  When you start the application, Visual Basic.NET uses the class definition to create the object. A class definition is simply a block of code that specifies (or defines) the attributes and behaviors of an object  Actions—such as clicking, double-clicking, and scrolling—are called events

Tutorial 1: An Introduction to Visual Basic.NET13 Visual Basic.NET Code – code window  You use the Class Name and Method Name list boxes to select the object and event, respectively, that you want to code  The Class Name list box lists the names of the objects included in the user interface  The Method Name list box, on the other hand, lists the events to which the selected object is capable of responding

Tutorial 1: An Introduction to Visual Basic.NET14 Visual Basic.NET Code – code template  The first line in the Code template is called the procedure header  And the last line is called the procedure footer  The Sub keyword is an abbreviation of the term sub procedure, which, in programming terminology, refers to a block of code that performs a specific task  The items within the parentheses are called parameters and represent information that is passed to the procedure when it is invoked

Tutorial 1: An Introduction to Visual Basic.NET15 The Code Window Code Editor window tab Class definition Event procedure

Tutorial 1: An Introduction to Visual Basic.NET16 ExitButton’s Click Event Procedure Private Sub ExitButton_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles ExitButton.Click Private SubIndicates the start of a code unit that can only be used in this class ExitButton_ClickThe name of the procedures is the object name and event name connected with an underscore sender As ObjectIdentifies the object creating the event e As System.EventArgsIdentifies specific information about the event HandlesIdentifies the object and event that this procedure will handle Note: If you are using a color monitor, the keywords in the code appear in a different color from the rest of the code

Tutorial 1: An Introduction to Visual Basic.NET17 The Event Procedure Private Sub ExitButton_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles ExitButton.Click Me.Close() ‘terminates the current application End Sub

Tutorial 1: An Introduction to Visual Basic.NET18 Completing the Copyright Screen Lesson C Objectives After completing this lesson, you will be able to:  Set the properties of a timer control  Delete a control from the form  Delete the code from the Code Editor window  Code the timer control’s Tick event  Remove and/or disable the Minimize, Maximize, and Close buttons  Prevent the user from sizing a form  Print the project’s code

Tutorial 1: An Introduction to Visual Basic.NET19 Using the Timer Tool  You can use a timer control to process code at regular time intervals when the enabled property is true  You simply set the control’s Interval property to the length of the desired time interval, in milliseconds  The Enabled property determines whether an object can respond to an event  You then enter the code you want processed each time interval into the control’s Tick event procedure

Tutorial 1: An Introduction to Visual Basic.NET20 Using the Timer Tool

Tutorial 1: An Introduction to Visual Basic.NET21 Setting the FormBorderStyle Property  The FormBorderStyle property determines the border style of a Windows Form object FromBorderStyle setting Description Fixed3DFixed, three-dimensional FixedDialogFixed, thick dialog-style FixedSingleFixed, thin line FixedToolWindowFixed, tool window style NoneNo border SizableSizable, normal style (default) SizableToolWindowSizable, tool window style

Tutorial 1: An Introduction to Visual Basic.NET22 The MinimizeBox, MaximizeBox, and ControlBox Properties  You can use a Windows Form object’s MinimizeBox property to disable the Minimize button that appears on the form’s title bar  Similarly, you can use the MaximizeBox property to disable the Maximize button  You can remove the title bar by setting the Windows Forms object’s ControlBox property to False, and then removing the text from its Text property

Tutorial 1: An Introduction to Visual Basic.NET23 Printing Your Code  You always should print a copy of the code entered in the Code Editor window, because the printout will help you understand and maintain the application in the future  To print the code, the Code editor window must be the active, or current, window