Visual Basic - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Visual Basic

Description:

Visual Basic Application. Forms. Controls. Events. Properties. Classes ... Set the properties for the controls. Write the code. Features of Visual Basic ... – PowerPoint PPT presentation

Number of Views:335
Avg rating:3.0/5.0
Slides: 14
Provided by: richard500
Category:
Tags: basic | visual

less

Transcript and Presenter's Notes

Title: Visual Basic


1
Visual Basic
Programming language used to create Windows-based
applications Based on Beginners All-purpose
Symbolic Instruction Code
  • Visual means that you paint the interface
    rather than use a number of lines of code to
    describe it

2
Visual Basic Application
Visual Basic Application
Forms
Events
Properties
Controls
Classes
Reusable procedures
Forms windows upon which the user interface is
built ActiveX Controls building blocks of the
interface Classes templates from which objects
are created at the runtime Events messages
that the operating system sends to the application
  • Procedures small routines that can be called
    from anywhere in the application

3
Hierarchy of a VB Application
Project Application Properties Forms
Properties Property Procedures Event Handlers
Other Procedures Controls Properties Event
Handlers Methods Modules Procedures Functions
Classes Properties Property Procedures Public
Methods Private Methods
4
Three Steps to Creating a VB Application
Create the interface Set the properties for
the controls Write the code
5
Features of Visual Basic
Superset of Visual Basic for Applications
Includes a GUI development environment
Integrated developing, testing and debugging
Can generate p-code and EXE files Object-based
development using class modules Rapid
application development Can create COM
components (ActiveX controls, DLLs, and EXEs)
Internet development possibilities include
ActiveX documents DHTML applications
(client-side/browser) IIS applications
(server-side) Web browser control FTP/HTTP
support through a custom control Winsock control
Task automation using wizards Extensible
through Windows API calls, third-party DLLs,
integration with other Windows applications using
COM and DCOM Database access methods for
different types of data
6
Advantages and Disadvantages of Visual Basic
Shorter learning curve compared to C/C Removes
the complexities of the Windows API from the
programmer Allows for rapid application
development Business applications! Used by most
of the Office Suite tools as a macro language
Object-based (but not object-oriented)
Integration with the Internet on both the server
and the client sides Integrates with MS
Transaction Server Has a large community of
developers Runtime distribution requirements are
larger than those of C/C Not as much
functionality as C/C in getting the features of
the OS
  • Can run servers either on the same workstation or
    remotely on other workstations (distributed
    processing)
  • Allows creating ActiveX controls using
    third-party controls and components

7
Code Generation Options
p-code Hybrid of interpreted and compiled
languages compiler compiles the source code, but
does not produce machine language. At the
runtime each line of p-code is interpreted,
turning it into a machine language Advantage
quick development time Native code (EXE) The
source code is translated directly into machine
code. Advantage quick runtime execution
8
Visual Basic Application Types
Standard EXEStandalone applications that do not
run within another application. Example
business applications. ActiveX EXEApplications
to be used by other applications for a particular
service normally do not have a visual interface
of their own. These services may run on the same
machine or remotely. ActiveX DLLApplications to
be used by other applications for a particular
service normally do not have a visual interface
of their own. The DLL must reside on the same
machine as the controlling application. The DLL
also may be run on another machine thats running
MTS. ActiveX ControlUsed to design OCX
components that can be used within a variety of
applications. ActiveX Document DLLUsed within
the context of another application. Similar to
ActiveX EXE and DLL, but provides an interface to
the calling application.
9
Visual Basic Application Types (continued)
ActiveX Document EXE IIS Application DHTML
Application
10
VB Application Components
Project (.VBP, .VBG)A collection of forms,
controls, references to automation servers,
application creation settings, and version
automation Form (.FRM, .FRX)A window displayed
on the desktop or inside an MDI form has
controls placed upon it. Control (.OCX)A tool
to display or retrieve information from the user
(boxes, buttons, graphics, labels, etc). Code
Module or standard modules (.BAS)Source code
makes controls and forms respond to user
interactions. Contain variable declarations,
constants, procedures or function declarations,
statements, etc. Class Module (.CLS)Declarations
of user-defined classes (with properties and
methods). User Control (.CTL, .CTX)User-defined
custom controls.
11
VB Application Components (continued)
Property Page (.PAG)Used to view and and change
the properties of a user control. User Document
or ActiveX Document (.VBD)Form or application
saved in a .VBD file creates an ActiveX DLL or
EXE file needed to display this VBD file. IIS
Application (.DSR, .DSX)Collection of WebClasses
(DLLs running under IIS 4.0) and WebItems (HTML
templates and/or classes that send out HTML to
the browser). DHTML ApplicationContains code
modules and designers that are stored in DSR and
DSX files. Resource file (.RC, .RES)Contains
Windows resources (strings, bitmaps, cursors, and
icons).
12
Procedural vs. Event-Driven Programming
Procedural programming Program is in control and
tells the OS what to do The user must follow the
programs flow Usually, no multitasking in
procedural systems Event-driven programming
OS is in control and it tells the program what
to do and what is going on using events Programs
work by responding to events Multitasking
13
Multitasking Environment
MessagesMultitasking OS kernel
message-processing engine. Events Mouse clicks
and movement, pressing a key, incoming mail,
timer ticks, etc. Control receiving an event has
a chance to respond to it. Not handled events
either discarded or a default action is taken by
the system. Message Queue Each generated
message is put into a queue (first-in,
first-out). FocusIndicates which window and
which control is currently receiving the data
input.
Write a Comment
User Comments (0)
About PowerShow.com