Overview of Microsofts Visual Basic - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

Overview of Microsofts Visual Basic

Description:

Name property Determines how objects are internally identified within the project. ... Visual Basic forms and controls have properties, which determine how the forms ... – PowerPoint PPT presentation

Number of Views:100
Avg rating:5.0/5.0
Slides: 31
Provided by: Bro72
Category:

less

Transcript and Presenter's Notes

Title: Overview of Microsofts Visual Basic


1
6
Chapter
Overview of Microsofts Visual Basic
2
6
  • Presentation Outline
  • Overview of Visual Basic
  • Components of VB Database Applications
  • VB Projects
  • VB Development Environment
  • Creating a VB Database Application
  • And much, much more

3
6
  • Overview of Visual Basic

What is Visual Basic (VB)?
  • Microsoft VB is a development language that
    enables programmers to create Windows-based
    programs.

4
6
  • Overview of Visual Basic

What is Visual Basic (VB)?
  • An event-driven programming language
  • Program statements execute in response to user
    actions or to system actions.

5
6
  • Overview of Visual Basic
  • In VB, you work with objects, which have
    properties and methods.
  • Objects i.e., forms (windows, dialog boxes,
    etc.) and controls (elements you place inside a
    form, such as a text box, command button, etc.)
  • Properties tell something about an object
    (name, color, size, location or how it will
    behave)
  • Methods actions associated with objects (Move,
    Print, Resize, Clear)

6
6
  • Overview of Visual Basic

Components of a VB Program
  • Project file every VB program has an individual
    project file, with a .vbp extension
  • Specifies properties of the program and names of
    the individual components of the program.

7
6
  • Overview of Visual Basic

Components of a VB Program
  • Project file
  • Main components of a VB project
  • Forms (.frm)
  • Visible interface that the user sees and
    interacts with and the
  • Associated code that responds to user and system
    actions

8
6
  • Overview of Visual Basic

Components of a VB Program
  • Project file
  • Main components of a VB project
  • Standard Modules
  • Contains only code
  • Used to store declarations for variables that are
    used in multiple forms

9
6
  • Overview of Visual Basic

Components of a VB Program
  • Project file
  • Main components of a VB project
  • Standard Modules (contd)
  • Procedure manipulates variable values
  • Function returns a single value based on
    parameters that are passed to the function.

10
6
  • Overview of Visual Basic

Components of a VB Program
  • Controls the visible items on a form

11
6
  • Visual Basic Projects
  • When VB is started, a new project is created,
    which corresponds to an individual user
    application
  • You can select the type of project it will be,
    which specifies how the project file is compiled.

12
6
  • Visual Basic Projects

Visual Basic project types
13
6
  • The VB Development Environment
  • Integrated development environment (IDE)
  • Environment for developing programs

VB IDE components
14
6
15
6
  • The VB Development Environment
  • Main IDE components include
  • The Toolbar provides quick access to menu bar
    commands for opening
  • The Object window shows the form and the position
    of the controls on the form
  • The Toolbox contains icons that are used to
    create form controls

16
6
  • The VB Development Environment
  • Main IDE components include
  • The Project Explorer displays a hierarchical list
    of the components of the current project
  • The Properties window is used to assign and
    display the properties of the object that is
    currently selected in the Form window

17
6
  • Creating a VB Database Application
  • Data control
  • Form control that is attached to a database table
  • Used to sequentially step through the record to
    view the items

18
6
  • Creating a VB Database Application

19
6
Modifying Form Properties
  • The properties of a VB object specify the
    objects appearance and behavior
  • Name property Determines how objects are
    internally identified within the project.
  • Must begin with a letter and can contain
    characters, numbers, or underscores.
  • Border Style determines whether the user can
    resize the form
  • Caption the form description displayed in the
    forms title bar

20
6
Modifying Form Properties
  • The properties of a VB object specify the
    objects appearance and behavior
  • MaxButton allows the user to maximize the form
    so that it is displayed full-screen
  • MinButton allows the user to minimize the form
  • StartUpPosition determines where the form is
    displayed on the screen when the application is
    running.

21
6
Saving VB Projects
  • A VB project is saved in a file with a .vbp
    extension
  • Forms are saved in files with an .frm extension
  • Note It is very important to always save the
    project .vbp file and the form .frm file in the
    same folder in your file system.

22
6
Using VB with a DB
Figure 6-12 Microsoft data access architecture
using ODBC
23
6
Creating an ActiveX Data Control
  • ActiveX data control
  • A control that is displayed on a form
  • Different from an ordinary form control because
    it is associated with a recordset
  • A specific set of database records based on a SQL
    query

24
6
Creating an ActiveX Data Control
Figure 6-14 ActiveX data control
25
6
Code in VB Programs
  • A VB project consists of forms and standard code
    modules
  • Every form and every code module has a section
    called the General Declarations section
  • Contains declarations for variables, and the code
    for functions and procedures

26
6
Variables in VB Programs
  • Visual Basic code has variables and data types
    just like other programming languages
  • It is a good programming practice to always
    declare variables before using them
  • VB does not require you to declare variables, but
    allows you to assign a value to a variable
    without declaring it first. This can lead to
    errors

27
6
Displaying VB Programs Using Web Pages
  • Visual Basic projects can be created to make
    standard executable files
  • Also can be created using different ActiveX
    options to make programs that can be installed
    and/or run by clicking a hyperlink on a Web page
  • When creating a Internet package using Package
    and Development Wizard, the Wizard creates an
    HTML file containing the command for the
    hyperlink that references the ActiveX document

28
6
Presentation Summary
  • Visual Basic is a development language and used
    to create Windows-based applications
  • A VB project can have forms and code modules
  • Visual Basic has an integrated development
    environment (IDE) with multiple windows for
    displaying and modifying project components

29
6
Presentation Summary
  • Visual Basic forms and controls have properties,
    which determine how the forms and controls look
    and function
  • An Open Database Connectivity (ODBC) driver is a
    program that allows an application to interact
    with a database
  • You can create a VB project that is an ActiveX
    document, which has both visual components and
    code, and can be displayed as a Web page using
    the Microsoft Internet Explorer browser

30
6
Chapter
Thank you for your attention this evening! Good
night!
Write a Comment
User Comments (0)
About PowerShow.com