an introduction to visual basic

13
An Introduction to Visual Basic Terms & Concepts

Upload: giulio

Post on 10-Jan-2016

27 views

Category:

Documents


6 download

DESCRIPTION

An Introduction to Visual Basic. Terms & Concepts. What is VB?. Visual Basic is a programming language (actually an environment) designed to create computer programs that run in Microsoft Windows. VB has been developed through many versions. This course uses VB 6.0. Getting Started. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: An Introduction to Visual Basic

An Introduction to Visual Basic

Terms & Concepts

Page 2: An Introduction to Visual Basic

What is VB?

• Visual Basic is a programming language (actually an environment) designed to create computer programs that run in Microsoft Windows.

• VB has been developed through many versions. This course uses VB 6.0

Page 3: An Introduction to Visual Basic

Getting Started

VB6 addresses problem solving

“from the outside, in.”

In other words, the user interface is designed and created first, then it’s Events are programmed.

Page 4: An Introduction to Visual Basic

The Windows GUI

• The Graphical User Interface is the means through which users can interact with programs.

• Each window is called a form.

• Each form is populated with controls.

Page 5: An Introduction to Visual Basic

The Windows GUI

• There are many different kinds of controls:– Label– Text box– Option button– Check box– Command button– Image– List box– Drop-down list– Frame– Line / Shape

Page 6: An Introduction to Visual Basic

A Sample Form

The Tools » Options dialog box in MSWord

Page 7: An Introduction to Visual Basic

Programming Language Paradigms

• Procedural

• Functional

• Declarative

• Object-oriented– Event-driven

In this paradigm we develop projects rather than programs.

Page 8: An Introduction to Visual Basic

Object Oriented Programming

A VB project consists of:– Objects - the nouns of OOP

• forms and controls are examples of objects.

– Properties - the adjectives• size, location, name, caption

– Methods - the verbs• Move, Print, Resize, Clear

The dot operator– Object.property is the syntax for referring to a

particular property of a particular object.

Page 9: An Introduction to Visual Basic

The Components of a Project

A VB project consists of at least two files:– projectName.vbp - the project file

• a text file that lists the names of all the other files in the project

– formName.frm - a form module• a description of all objects and their properties for

each form, AND the Basic code written to handle events

Page 10: An Introduction to Visual Basic

Creating VB Projects

PlanningPlanning

1. Design the interface

2. Plan the properties for all the controls

3. Plan the Basic code

ImplementingImplementing

1. Define the interface

2. Set the properties

3. Write the Basic code

Page 11: An Introduction to Visual Basic

Working with VB

VB has 3 modes:• Design

– The editor is used to create and change programs.

• Run– Executes the program.

• Break– Running is suspended to report an error in the

program.

Page 12: An Introduction to Visual Basic

The Visual Basic Environment

• Form Window

• Project Explorer Window

• Properties Window

• Form Layout Window

• Toolbox

• The Main VB Window

• Toolbar

Page 13: An Introduction to Visual Basic

The Visual Basic Environment