Introduction To Visual Basic 6. Announcements  Thursday, Oct 9th, 7:30PM, C106 Lloyd Douglas (NSF) Diversity in Science-Who needs it? 5 extra credits.

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

CE 311 K Introduction to Computer Methods VB Controls and Events Daene C. McKinney.
VISUAL BASIC Visual Basic is derived from the Basic language (Beginner’s All-Purpose Symbolic Instruction Code) Visual Basic uses an event-driven programming.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Chapter 1 - VB 2008 by Schneider1 Chapter 1 - An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and.
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.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
 2002 Prentice Hall. All rights reserved. Chapter 2 - Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Overview of the Visual Studio.NET.
Compunet Corporation Programming with Visual Basic.NET GUI Week # 11 Tariq Ibn Aziz.
Chapter 1- Visual Basic Schneider 1 Chapter 1 An Introduction to Computers and Visual Basic.
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.
Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
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.
CS 0004 –Lecture 8 Jan 24, 2011 Roxana Gheorghiu.
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
Microsoft Visual Basic 2005: Reloaded Second Edition
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
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.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
Copyright © 2001 by Wiley. All rights reserved. Chapter 2: Using Visual Basic to Create a First Project Getting Started with VB Development Environment.
Visual C++ Programming: Concepts and Projects
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
 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.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
CHAPTER TWO INTRODUCTION TO VISUAL BASIC © Prepared By: Razif Razali 1.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
Chapter Two Creating a First Project in Visual Basic.
Chapter 2 – Introduction to the Visual Studio .NET IDE
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
VB Objects & Events (Exercises) School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Friday 1/31/2003)
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Visual Basic Review LBS 126. VB programming Project Form 1Form 2Form 3 Text boxButton Picture box Objects Text box Button Objects.
More Visual Basic!. Creating a Standalone Program A standalone program will allow you to make a program file that can be run like other Windows programs,
Data and variables in Visual Basic. Annoucement Lecture on Thursday 7:30PM C106 Visual Basic download: 
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 Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
Software Development Languages and Environments. Computer Languages Just as there are many human languages, there are many computer programming languages.
Chapter 4: Do-It-Yourself Designing (Designing Interfaces)
Introduction To Visual Basic 6
Introduction to Programming and Visual Basic
Chapter 1: An Introduction to Visual Basic 2015
Visual Basic Code & No.: CS 218
Introduction to Computer CC111
Chapter 2 – Introduction to the Visual Studio .NET IDE
An Introduction to Computers and Visual Basic
3.01 Apply Controls Associated With Visual Studio Form
1. Introduction to Visual Basic
3.01 Apply Controls Associated With Visual Studio Form
An Introduction to Computers and Visual Basic
Standard Controls.
Please use speaker notes for additional information!
CIS16 Application Development Programming with Visual Basic
Building an Application in the Visual Basic .NET Environment
Chapter One: An Introduction to Programming and Visual Basic
An Introduction to Computers and Visual Basic
Presentation transcript:

Introduction To Visual Basic 6

Announcements  Thursday, Oct 9th, 7:30PM, C106 Lloyd Douglas (NSF) Diversity in Science-Who needs it? 5 extra credits.  About the extra credit Please submit printed copy. Don’t hand in through blackboard system or send .

Programming language  Programming is writing instructions for a computer.  Level of programming languages Machine language – 0s and 1s Intermediate languatge – assambly language. High level language – BASIC, C++ …

Interpreting or compiling  How do computers handle the high level language? Read and Interprete the code line by line with an program called interpreter, e.g. BASIC. Translate the language to machine code (executable files) with a program called compiler and run the program, e.g. C++. Visual basic has both Interpreter and Compiler.

History of BASIC  Basic --- Beginners' All-purpose Symbolic Instruction Code (May, 1964)  MS-BASIC 2.0 (July, 1975)  Visual Basic 1.0 (May,1991)  Visual Basic 6.0 (July 1998)

Why do we learn Visual Basic  It shares the same principles with other programming languages.  It is good when developing small and handy utility programs.  It is supported by Microsoft.  It is powerful when integrated with Excel and Word.

Six Steps in Programming  Problem Identification  Solution Design  Coding  Compiling with compiler or running with interpreter  Debugging  Testing

Step 1 and 2: Problem Identification and Design  Identify what needs to be solved Make diagrams, and equations, etc  Design: Analyze the problem and develop an ALGORITHM and FLOWCHART

Step 3: Source Code  Creating “Source Code” Source Code is the instructions for the computer written in Visual Basic programming language In VB, source code is linked to an object on the form Designing user interface is also part of the coding.

Step 4a:Compiling  Compiling converts Visual Basic source code to “executable” machine language - instructions the processor can understand (1s and 0s)  Creates.exe file  Advantage: Fast and small  Disadvantage: Debugging is inconvenient.

Step 4b: Interpreting  Interpreting reads and runs one line of code each time.  You can find “Grammar errors” in this stage.  Advantage: Good for debugging Interpreter is easy to program.  Disadvantage: Slow

Interpreting and Compiling in VB

Step 5: Debugging  Debugging is removing the “functional errors” from your program  Running tells you where there are errors  Go back to source code and fix errors  Save and re-run  Repeat until errors are gone

Step 6: Testing and Running  Try to run the program by pressing the start button  If it starts running, enter the answers and/or click the buttons to test it  Test your program with boundary and special cases.

Visual Basic Programming  VB is a programming language that allows you to program in a Windows environment  You create a “Form” with several “Objects”  You set the properties of objects.  You write event handler to response to user’s input.

VB programming Project Form 1Form 2Form 3 Text boxButton Picture box Objects Text box Button Objects

Definitions  Form contains the Main Program  Controls are user interface elements (text boxes, commands) in the Form  Forms and Controls are referred to as OBJECTS  Objects have PROPERTIES (features you can change)

Forms in Visual Basic  You create a form that is your graphical user interface  Has places to input values  Has buttons to click  Has other user interface elements, e.g. Menu, scroll bar…

Objects in VB  Everything in VB is objects, forms, buttons,…  Three elements of objects. Properties Methods Event handlers. Properties (size, Caption…) Methods (Print…) Event Handler (Command1_Click()) VB object

Object: Dog  Properties Height, weight, color, emotion (friendly, hostile)…  Methods Barking, biting, wagging, singing…  Event handlers Owner coming in: call wagging, call singing, emotion=friendly; Intruder coming in: call barking, call biting, emotion=hostile.

Important Controls  Text Boxes – area where you enter text  Command Buttons – you click on them to do something  Picture Boxes – Output your results.

Text Boxes  Properties: Name (of object) Text (the words) Alignment (left, right, middle) Appearance BackColor (background) BorderStyle Font FontColor

Command Button  Properties: Name BackColor Style (This controls the backcolor) Caption

Picture Boxes  Properties Name Picture  Methods Print

Definitions Objects Forms Command Button properties Methods properties Methods Textbox properties Methods Picture Box properties Methods Label properties Methods Handlers properties Methods

“ Design time ” and “ Run time ”  When you design you can use the property window to set the property of certain object.  When you run the program, you can only use code to change the property of that object.

Just a Bunch of Objects  Q: Now that you have a bunch of objects, how do you make them react to your command? A: Sub Procedures  Sub Procedures are the instructions  Sub Procedures go with Events (Like clicking a button)

How the test program works

Message Dispatching Block User Text box Properties Methods Event Handler Button Properties Methods Event Handler Picture Box Properties Methods Event Handler You have got letters. You have got clicked.

Making It Do Something  Want program to change on an “Event” Events:  MouseDown  MouseUp  Click  Need to create Sub Procedures  Sub Procedure handles Event and changes Properties of an Object

Sub Procedure  Two Objects: Text1 and Command1 Sub Procedure: Private Sub Command1_Click() Text1.FontSize = 18 End Sub  When Command1 is clicked, the FontSize property of Text1 is changed to 18

Sub Procedure Private Sub CommButt_Click() Text1.FontSize = 18 Text1.BackColor = vbBlue Command1.Caption = "Get Some Now" End Sub

Homework  Read Chapters 1 & 2 in book