Outline Review Visual Basic.NET Environment Review Visual Basic.NET Environment First Visual Basic Planning and Programming First Visual Basic Planning.

Slides:



Advertisements
Similar presentations
Using Macros and Visual Basic for Applications (VBA) with Excel
Advertisements

Chapter 2 –Visual Basic, Controls, and Events
Chapter 1: An Introduction to Visual Basic.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Chapter 1 Introduction to Visual Basic.NET Programming In Visual Basic.NET © 2001 by The McGraw-Hill Companies, Inc. All rights reserved.
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.
 Visual Basic is an object-oriented language used to write application programs that run in Windows or on the Internet using a graphical user interface.
Chapter 2 –Visual Basic, Controls, and Events
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
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 Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
IE 411/511: Visual Programming for Industrial Applications
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
Chapter 3 Introducing Visual Basic.NET. 3.1 Visual Basic.NET Windows Programming -Used to create Windows, Web, and Console applications -Uses predefined.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Introduction to Visual Basic.NET Programming In Visual Basic.NET.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 2 The Visual Basic.NET Integrated Development Environment.
Introduction to Visual Basic.NET Chapter 2 Introduction to Controls, Events.
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.
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.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
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.
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
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.
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.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
CSC 157 (Blum)1 Hello World. CSC 157 (Blum)2 Start/Programs/Microsoft Visual Studio.NET 2003/Microsoft Visual Studio.NET 2003.
Chapter 3 - VB.NET by Schneider1 Chapter 3 – Fundamentals of Programming in VB.NET Part I VB.NET Controls VB.NET Events.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
BBT 10 Visual Basic 03 Enrichment. Tip Before creating any files for your project, first create a new folder Save all of your files in the folder Pieces.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
Chapter 1 Introduction to Visual Basic.NET Programming In Visual Basic.NET © 2001 by The McGraw-Hill Companies, Inc. All rights reserved.
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.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
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.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 2 The Visual Basic.NET 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 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.
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.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 6 Looping and Multiple Forms.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
2-1 Chapter 2 Using VB.NET to Create a First Solution.
Chapter 1: An Introduction to Visual Basic .NET
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
3.01 Apply Controls Associated With Visual Studio Form
How to design a Windows Forms application
3.01 Apply Controls Associated With Visual Studio Form
CIS16 Application Development Programming with Visual Basic
Visual Studio.
Presentation transcript:

Outline Review Visual Basic.NET Environment Review Visual Basic.NET Environment First Visual Basic Planning and Programming First Visual Basic Planning and Programming Finding and Fixing Errors – Debugging Finding and Fixing Errors – Debugging Summary Summary

Using Microsoft Visual Studio.NET

Using Microsoft Visual Studio.NET (continue)

Naming Rules and Convention Examples: ObjectPrefixExample FormfrmfrmHello ButtonbtnbtnPush TextboxtxttxtName LabellbllblMessage Radio button radradBold Check BoxchkchkPrint

A First Program Example Develop a simple program that Develop a simple program that Display a titleDisplay a title Has one Label that display data when a button is pressedHas one Label that display data when a button is pressed Has two ButtonsHas two Buttons Write procedure code for each event Write procedure code for each event Save the form Save the form Save the project Save the project Run the program Run the program

Planning: GUI Design Text displayed here Push Me Exit frmHello lblMessage btnPush btnExit Text property ECET/CS 114 Label

Planning: Object Properties Form Form Name: frmHelloName: frmHello Text: Hello worldText: Hello world Size: as requiredSize: as required Label at top of form Label at top of form Let VB name this label (default)Let VB name this label (default) Text: “MIS 255” Font: Default, size to fit label boxText: “MIS 255” Font: Default, size to fit label box First Information Label First Information Label Name: lblMessage, Text: Blank, Font: Default, size to fit label boxName: lblMessage, Text: Blank, Font: Default, size to fit label box BASIC code in buttons displays data in labelBASIC code in buttons displays data in label

Program Development Example Event Statement Write a VB.NET program that displays the information when a display button is clicked; and exit the program when the exit button is clicked: Press button to display “Hello World”Press button to display “Hello World” Press button to ExitPress button to Exit

Define GUI Text displayed here ECET/CS 114 Exit Push Me Labels

Define the User Interface - Create a Form Plan the project – one label, two buttonsPlan the project – one label, two buttons Resize the form by drag a corner of the form handle itResize the form by drag a corner of the form handle it Text –Form1 at the Properties windowText –Form1 at the Properties window

Define the User Interface (continued) - Place Control on the Form Point to the toolbox icon to open the toolbox on the left sidePoint to the toolbox icon to open the toolbox on the left side Place controls on the formPlace controls on the form Point to A Label and drag, drop on the formPoint to A Label and drag, drop on the form

Define the User Interface (continued) - Create Label Drag the mouse pointer to the spot where you want to Drag the mouse pointer to the spot where you want to Pointer to a corner and resize the label on the form Pointer to a corner and resize the label on the form

Define the User Interface (continued) - Set Label Properties Click on the label you place on the form Object box Settings box Value in the Settings box

Define the User Interface (continued) - Set Label Properties

Define the User Interface (continued ) - Label Properties

Define the User Interface (continued) - Place Control on the Form Point to Label in the Toolbox and drag, drop on the Form to CreateAnotherlabel

Define the User Interface (continued) - Place Control on the Form TextAlignproperty Textproperty Nameproperty

Point toPoint to Button in the Toolbox and drag, drop on the Form where you want to Point to a corner and resize the button on the form Point to a corner and resize the button on the form Assign button name: btnPush

Define the User Interface (continued) - Place Control on the Form Double click on the button control to create the second button Double click on the button control to create the second button Point to the control and drag the label on the form Point to the control and drag the label on the form Assign button name: btnExit

Define the User Interface (continued) - Place Control on the Form Lock Controls -To prevent your form accidentally moving the controls Lock Controls -To prevent your form accidentally moving the controls

Define the User Interface (continued) - Set Properties Object box Settings box Value in the Settings box

Define the User Interface (continued) - Set Properties for Buttons

Define the User Interface (continued) - Set Properties for From1 Double Double click on Form1 Click ClickAnywhere on the Form to Change Properties Properties of the Form

Define the User Interface (continued) - Set Properties Change the Text property to “Hello World by Melissa” Change the Text property to “Hello World by Melissa” Hello World by Melissa is displayed at the title of the Form Hello World by Melissa is displayed at the title of the Form Change the Name property to frmHello Change the Name property to frmHello

Define the User Interface (continued) - Set File Name In the Solution Explorer, right click on Form.vb In the Solution Explorer, right click on Form.vb Choose Rename from the shortcut menu Choose Rename from the shortcut menu

Define the User Interface (continued) - File Name Change the file name from Form1.vb to frmHello.vb

Define the User Interface (continued) - Set Startup Object In the Solution Explorer, click on project1, then properties filename Name of the Formclass

Define the User Interface (continued) - Set Startup Object In the Project Property dialog box, drop down the list for Startup Object and select frmHello In the Project Property dialog box, drop down the list for Startup Object and select frmHello Click Apply then click OK Click Apply then click OK

Comments and the Assignment Statement Comment Comment used to document codeused to document code Syntax exampleSyntax example ' this is a comment Assignment Assignment used to assign a value to a property (or a variable)used to assign a value to a property (or a variable) SyntaxSyntax variable = value ExamplesExamples Pi = 3.14 Pi = 3.14 lblMessage.ForeColor = Color.Red lblMessage.ForeColor = Color.Red lblMessage.BackColor = Color.Yellow lblMessage.BackColor = Color.Yellow lblMessage.Text = "WebCT is a pretty good tool." lblMessage.Text = "WebCT is a pretty good tool."

Write Code Develop a Visual Basic code in Procedures Develop a Visual Basic code in Procedures A sub procedure begins with Private Sub and ends with End Sub A sub procedure begins with Private Sub and ends with End Sub The Remark statement The Remark statement CommentsComments The Assignment Statement The Assignment Statement Assigns a value to a property or variableAssigns a value to a property or variable Ex: btnHello.Hide()Ex: btnHello.Hide() lblMessage.Show() lblMessage.Show() Me.Close() Me.Close()

Write Code (continue) A Space then an Underline enables you to press the enter key and continue a line of code on a new line. Each method is defined as a VB procedure Each method is defined as a VB procedure For methods which correspond to events, VB automatically names the procedure For methods which correspond to events, VB automatically names the procedure Private Sub btnPush_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnPush.Click End Sub

Write Code (continued) Click on Push Me button

Write Code (continued) Method List Assignment Statement Remark Statement Editor tab Form Designer tab Class List

Write Code (continued) Click on Exit button

Write Code (continued) Edit one line of Comment and one line of Code Class List Method List

Write Code (continued)

Save the Project Open the File menuOpen the File menu Choose Save AllChoose Save All

Compiler the project Click on Build, then Select Build Solution

Clean Compile & Build

Run the Project Open the Debug menu Open the Debug menu Select Start without debugging Select Start without debugging

Result of the Project When Click on Push Me button – display Hello WorldWhen Click on Push Me button – display Hello World When Click on Exit button – Close the windowWhen Click on Exit button – Close the window

Code View Help The VB Environment

Summary Program Planning and GUI Program Planning and GUI Visual Basic Programming Visual Basic Programming Use ToolboxUse Toolbox Edit propertiesEdit properties Write codeWrite code Run the projectRun the project