The Initial Visual Basic Screen

Slides:



Advertisements
Similar presentations
VISUAL BASIC Visual Basic is derived from the Basic language (Beginner’s All-Purpose Symbolic Instruction Code) Visual Basic uses an event-driven programming.
Advertisements

Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Excel Project 7 Using Macros and Visual Basic for Applications (VBA) with Excel.
Using Macros and Visual Basic for Applications (VBA) with Excel
How to get started with Excel VBA. We need to enable programming in Excel  the “Developer menu”
Visual Basic Project Files:.VBP file: Project File: a small text file that contains the names of other files in the project, as well as some information.
Chapter 2 –Visual Basic, Controls, and Events
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.
Fundamentals of Programming in Visual Basic
PROBLEM SOLVING The first step in writing instructions to carry out a task is to determine what the output should be (What should the task produce?) The.
Fundamentals of Programming in Visual Basic
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
Visual Basic Project Files:.VBP file: Project File: a small text file that contains the names of other files in the project, as well as some information.
Compunet Corporation Programming with Visual Studio.NET GUI Week 13 Tariq Aziz and Kevin Jones.
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 بسم الله الرحمن الرحيم Palestine Polytechnic University College of Administrative science and.
The Visual Basic Integrated Development Environment.
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.
VB Code Statements 3 types of VB statement The Remark statement, known as comments, are used for project documentation only Begin with an apostrophe Not.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
Chapter 2 –Visual Basic, Controls, and Events
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.
WORKING WITH MACROS CHAPTER 10 WORKING WITH MACROS.
Programming Practice in Visual Basic The Initial Visual Basic Screen Toolbox Project Explorer window Properties window Form Menu bar Description pane.
Fundamentals of Programming in Visual Basic
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.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
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.
© 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.
Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT.
1 1 Lab1 Ismail M. Romi – IT Dept, PPU, Visual Basic 2005 Programming Tour.
Chapter 3 – Fundamentals of Programming in VB.NET VB.NET Controls VB.NET Events Numbers Strings Input and Output.
Introduction to Visual Basic.NET Chapter 2 Introduction to Controls, Events.
Copyright © 2001 by Wiley. All rights reserved. Chapter 2: Using Visual Basic to Create a First Project Getting Started with VB Development Environment.
 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.
Microsoft Visual Basic 2012 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 Two Creating a First Project in Visual Basic.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
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.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
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.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
Chapter 3 - VB.NET by Schneider1 Chapter 3 – Fundamentals of Programming in VB.NET Part I VB.NET Controls VB.NET Events.
Introduction to Programming Fundamentals of Programming in Visual Basic.
VB Objects & Events (Exercises) School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Friday 1/31/2003)
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.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
Chapter 31 Fundamentals of Programming in Visual Basic (VB) Visual Basic Events Simple Statement.
Chapter 31 Fundamentals of Programming in Visual Basic (VB) Visual Basic Events Simple Statement.
Programming with Visual Basic.NET. Quick Links Program Code The Code Window The Event Procedure Assignment Statements Using AutoList Radio Buttons Buttons.
Microsoft Expression Web - Illustrated Unit A: Getting Started With Microsoft Expression Web.
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 7 Multiple Forms, Modules, and Menus. Section 7.2 MODULES A module contains code—declarations and procedures—that are used by other files in a.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
ALMAJMA'AH UNIVERSITY College of Science and Humanitarians Studies in Alghat Information Technology Section (211Tal course) 1.
Visual Basic.NET Windows Programming
Chapter 2: The Visual Studio .NET Development Environment
1. Introduction to Visual Basic
Microsoft Excel 2003 Illustrated Complete
Chapter 2 Visual Basic Interface
Building an Application in the Visual Basic .NET Environment
Introduction to Programming
Presentation transcript:

The Initial Visual Basic Screen Menu bar Project Explorer window Toolbar Toolbox Properties window Description pane Form Project Container window Form Layout window

Steps to Create a Visual Basic Program 1. Create the interface by placing controls on the form 2. Set properties for the controls and the form 3. Write code for event procedures associated with the controls and the form

Placing a Text Box on a Form Double-click on the text box icon in the toolbox to add a text box to your form Activate the properties window (Press F4) Set values of properties for text box Go over resizing and dragging the text box The first line of the properties window (called the object box) reads “Text1 TextBox” . Text1 is the current name of the textbox. The two Tab permit you to view the list of properties either alphabetically or grouped by categories.. We discuss four properties : The Text property determines the words in the text box. Press Shift+Ctrl+F to move to the first property beginning with F . Move to the property ForeColor. The foregroung color is the color of the text.. Click on Palette tab to display a selection of colors. Highlight the Font property and change it to Italic

Placing a Text Box on a Form

Private Sub cmdPush_Click. ‘Display the ‘Hello World’ Message Private Sub cmdPush_Click ‘Display the ‘Hello World’ Message lblMessage.Caption = “Hello World” End Sub *********************************************** Private Sub cmdExit_Click ‘Exit the project End End Sub Comment Assignment

Naming Objects:

Visual Basic Events Code is a set of statements that instruct the computer to carry out a task. Code can be associated with events When an event occurs, the code associated with that event (called an Event Procedure) is executed. When a VB program is run, a form and its controls appear on the screen. Normally, nothing happens until the user takes an action, such as clicking a control or pressing the Tab key. Such an action is called event.

Creating An Event Procedure Double-click on an object to open a Code window. (The empty default event procedure will appear. Click on the Procedure box if you want to display a different event procedure.) Write the code for that event procedure. Object Property Setting frmWalkthrough Caption Demonstration txtPhrase Text (blank) cmdBold Caption Make Phrase Bold Object Box Procedure Box: Contains a list of all possible event procedures associated with the text box Choose txtPhrase_LostFocus() txtPhrase.Font.Size = 12 End Sub Choose GotFocus and type: txtPhrase.Font.Size = 8 txtPhrase.Font.Bold = False Go to command Button and choose cmdBold_Click and type txtPhrase.Font.Bold = True

Example of An Event Procedure Private Sub objectName_event ( ) statements End Sub Private Sub txtOne_GotFocus( ) txtOne.Font.Size = 12 txtOne.Font.Bold = False The word Sub signals the beginning of the event procedure, and also identifies the Object and the event occurring to that object The word private indicates that the event procedure cannot be invoked by an event from another procedure. The word Sub means subprogram Example: the event procedure private Sub cmdButton_Click () txtBox.Text = “” End Sub The event clicking cmdButton is different from the event clicking picBox_Click

More Examples Private Sub cmdButton_Click( ) txtBox.ForeColor = vbRed txtBox.Font.Size = 24 txtBox.Text = “Hello” End Sub Each color can be identified by a sequence of digits and letter beginning with &H. &HFF& = Red &HFF00& = Green &HFF000& = Blue