CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.

Slides:



Advertisements
Similar presentations
© by Pearson Education, Inc. All Rights Reserved.
Advertisements

Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
© by Pearson Education, Inc. All Rights Reserved. continued …
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
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.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
JavaScript “Hello World” in Microsoft Visual Studio August 2012.
Chapter 2 –Visual Basic, Controls, and Events
CS0004: Introduction to Programming Events. Review  Event Procedure  A set of instructions to be executed when a certain event happens.  Many event-driven.
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.
Visual Basic Chapter 1 Mr. Wangler.
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.
CIS 338: Creating ActiveX Controls Dr. Ralph D. Westfall March, 2003.
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.
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.
Chapter 3: Using GUI Objects and the Visual Studio IDE.
A First Look At Microsoft Visual Basic Lesson 1. What is Microsoft Visual Basic? Microsoft Visual Basic is a software development tool, which means it.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
 2009 Pearson Education, Inc. All rights reserved Introduction to the Visual Basic Express 2008 IDE.
 2009 Pearson Education, Inc. All rights reserved Dive Into ® Visual C# 2008 Express.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
 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.
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.
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 Two Creating a First Project in Visual Basic.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
CSD 340 (Blum)1 Using Visual Studio CSD 340 (Blum)2 Start/Microsoft Visual Studio 2005/Microsoft Visual Studio 2005.
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.
Chapter 2 – Introduction to the Visual Studio .NET IDE
CSC 157 (Blum)1 Hello World. CSC 157 (Blum)2 Start/Programs/Microsoft Visual Studio.NET 2003/Microsoft Visual Studio.NET 2003.
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.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
Forms and Controls Part 3 dbg --- Naming conventions, Button, Event handlers, Label.
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.
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.
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.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
 You won’t write a single line of program code.  Instead, you’ll use visual programming techniques.  Visual Studio processes your actions (such as mouse.
ALMAJMA'AH UNIVERSITY College of Science and Humanitarians Studies in Alghat Information Technology Section (211Tal course) 1.
Visual Studio 2010 Hello World CSC 230.
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
JavaScript “Hello World” in Microsoft Visual Studio 2012
Program and Graphical User Interface Design
3.01 Apply Controls Associated With Visual Studio Form
Introduction to the Visual C# 2005 Express Edition IDE
Visual Studio 2010 Hello World CSC 230.
Chapter 2 – Introduction to the Visual Studio .NET IDE
CIS16 Application Development Programming with Visual Basic
Hello World in Visual Basic
Building an Application in the Visual Basic .NET Environment
Presentation transcript:

CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum

CSC 230 (Blum)2 Start/All Programs/Microsoft Visual Studio 2005/Microsoft Visual Studio 2005

CSC 230 (Blum)3 This takes a long time the first time you start Visual Studio on a particular computer. I recommend starting VS on a bunch of computer in case you have to move from “your” computer some day.

CSC 230 (Blum)4 You may be asked about your default environment settings. My suggestion is General Development.

CSC 230 (Blum)5 Click on Project next to Create in the Recent Project panel or go to File/New Project

CSC 230 (Blum)6 Choose Visual Basic and Window Applications (not done yet).

CSC 230 (Blum)7 Change the Name textbox (should change the Solution Name as well). Use the Browse button to determine the project’s location.

CSC 230 (Blum)8 Result so far.

CSC 230 (Blum)9 With the “form” highlighted, go to the Properties Window and change the (Name) property (e.g. to “FrmHelloWorld”) Properties Window: If you don’t have the Properties Window showing, you can get it by going to View/ Properties Window on the menu bar

CSC 230 (Blum)10 Right click on the Form file shown in the Solution Explorer and select Rename from the Context sensitive menu

CSC 230 (Blum)11 Enter a name for the file (e.g. FrmHelloWorld.vb) containing the file containing your Visual Basic code

CSC 230 (Blum)12 Change the Text Property of the Form.

CSC 230 (Blum)13 Go to File/Save All

CSC 230 (Blum)14 A look at the files and folders created in My Computer.

CSC 230 (Blum)15 Place the mouse over the Toolbox tab, the toolbox emerges. To hold it in place click on the tack icon.

CSC 230 (Blum)16 Click on the Button button and then when the mouse is moved over the form it turns into a cross hairs icon. Drag from the upper left to lower right hand corner of where you would like the button placed.

CSC 230 (Blum)17 The Button can be moved by using the clicking on Pointer and then placing the mouse in the center (obtaining the four-arrow icon) and dragging.

CSC 230 (Blum)18 Resizing To change the size, move the mouse to the edge of the button to obtain the two headed icon and then drag. One can also change the Location and Size by editing the appropriate settings in the Properties Window.

CSC 230 (Blum)19 I prefer my properties to be alphabetized, so I clicked the Alphabetical button. You can go back to categorized by clicking that button.

CSC 230 (Blum)20 Change the (Name) property (e.g. to btnMessage).

CSC 230 (Blum)21 Naming Conventions The items placed on the form are known as “controls.” You should rename any control that you are going to have appear in your code. It is traditional to give VB control names a prefix indicating the type of control (in this case “btn” for button). The rest of the name should describe the purpose of the control and typically starts with a capital letter (in this case “Message” because clicking the button causes a message to be displayed).

CSC 230 (Blum)22 Change the Text property to change what the button says.

CSC 230 (Blum)23 Change the BackColor property of the button by clicking on the drop down list, selecting the Web tab and then choosing a color from the list.

CSC 230 (Blum)24 Add a label to the form.

CSC 230 (Blum)25 Change the (Name) property.

CSC 230 (Blum)26 Change the BackColor property of the label.

CSC 230 (Blum)27 Click in the region next to Font and then on the ellipsis button that appears.

CSC 230 (Blum)28 Use the Font dialog box to change the font size.

CSC 230 (Blum)29 Change the Text property.

CSC 230 (Blum)30 Move the label and add a border.

CSC 230 (Blum)31 Change the Visible property to False. You can still see the label in “design” but the user will not see it at run time.

CSC 230 (Blum)32 Go to Debug/Start Debugging on the menu

CSC 230 (Blum)33 The form during run time does not display the “Hello World” message. Click the Close (X) button to stop running the program.

CSC 230 (Blum)34 Our goal Our goal is to have the message “Hello World” display when the user clicks the button. The user’s clicking of the button is said to raise an event – the click event. We have to write code that handles that event (instructs our program what to do when the event is raised – in this case, make the message visible).

CSC 230 (Blum)35 Double clicking on the button takes over to Code View and creates the boiler plate for our method that will handle the button’s click event.

CSC 230 (Blum)36 Note some of the key words: Public, Class, Private, Sub, ByVal The name of the “class” is the name we gave our form. The name of the subroutine is btnMessage_Click derived from the control and its event.

CSC 230 (Blum)37 Rest of it While the name of the subroutine was derived from the control and its event, that is only a name (and “A rose by any other name …”) but the code shown above is what really associates the action of clicking the button with the execution of the code in this subroutine.

CSC 230 (Blum)38 Between Private Sub … and End Sub lines type the code. After typing the code name of the label and a dot, IntelliSense provides a dropdown list of label properties and events.

CSC 230 (Blum)39 Type Visible or find it on the drop down list, then type “=,” after that IntelliSense provides another drop down list.

CSC 230 (Blum)40 Line of code and a comment (anything after an apostrophe). Comments do not affect execution of code. They help explain code.

CSC 230 (Blum)41 Comments are also used to take credit for code. Always have a comment with your name at the top of every program submitted for credit.

CSC 230 (Blum)42 The running program after the button has been clicked.