0 index
1 Purpose of the class
2 What we are learning
3 Why program?
4 Hardware information
5 Computer requirements
6 Solving problems with STAIR
7 History of programming
8 Birth of programming languages
9 Higher level languages
10 Windows-general characteristics
11 Programming differences-DOS
12 Programming differences-WINDOWS
13 Visual Basic Guided Tour
14 Naming a form
15 Changing the form's caption
16 Adding a picture box
17 Picture box
18 Adding some code to Picture box
19 Some concepts
20 Variable = value
21 Saving the program
22 Use the Disk icon to save
23 Test the program
24 Save the program

outline
created using slideshow.cgi by Andy Harris















CSCI N331 Visual Basic: n331/1_VB_Intro
1. Purpose of the class
  • Who is it for?



































CSCI N331 Visual Basic: n331/1_VB_Intro
2. What we are learning
  • Programming essentials
  • Specific languages
  • Emphasis on concepts
  • Practical applications
       - educational
       - scientific
       - business settings



































CSCI N331 Visual Basic: n331/1_VB_Intro
3. Why program?
  • History
  • Usefulness now
  • Engineer analogy



































CSCI N331 Visual Basic: n331/1_VB_Intro
4. Hardware information
  • Disk
       - floppy 1.44 meg
       - you may want to have 3 available - one to turn in, two to work on



































CSCI N331 Visual Basic: n331/1_VB_Intro
5. Computer requirements
  • Visual Basic v6.0



































CSCI N331 Visual Basic: n331/1_VB_Intro
6. Solving problems with STAIR
  • S  tate the problem
  • T  ools
  • A  lgorithm
  • I  mplementation
  • R  efinement



































CSCI N331 Visual Basic: n331/1_VB_Intro
7. History of programming
  • Sumerian Algorithms
  • Abu Ja'far Muhammad ibn-Musa Al-Khowarizimi (algorithm is derived from the last name)
  • Pascaline 1659
  • Analytical Engine 1834
  • Lady Ada



































CSCI N331 Visual Basic: n331/1_VB_Intro
8. Birth of programming languages
  • Eniac - cords and wires
  • Grace Hopper and A0-first compiler
  • (first bug - origin of debugging)



































CSCI N331 Visual Basic: n331/1_VB_Intro
9. Higher level languages
  • Fortran - first practical higher level language
  • COBOL - business oriented
  • PASCAL - teaching language
  • BASIC - hobbyist's language
  • QuickBASIC - BASIC comes of age
  • OOP - object oriented programming (C, PASCAL)
  • Next generation - Hypertalk, Visual BASIC



































CSCI N331 Visual Basic: n331/1_VB_Intro
10. Windows-general characteristics
  • GUI, graphically based
  • Multiple ways to do things, User-driven
  • Device Independence, Event oriented
  • Mouse is critical, Multi-tasking



































CSCI N331 Visual Basic: n331/1_VB_Intro
11. Programming differences-DOS
  • Programmer in control, user interface up to programmer
  • User has few options - computer 'train' the user
  • Programmer must anticipate user's wishes
  • Procedural program design, programmer directly responsible for all device control



































CSCI N331 Visual Basic: n331/1_VB_Intro
12. Programming differences-WINDOWS
  • User in control
  • OOP - object oriented program design
  • Standardized user interface
  • Generally harder to program, easier to use



































CSCI N331 Visual Basic: n331/1_VB_Intro
13. Visual Basic Guided Tour
  • Parts of the VB Editor
  • Menu bar, Tool bar, Tool box, Project window, Properties box
  • Using menu bar to show, hide other components



































CSCI N331 Visual Basic: n331/1_VB_Intro
14. Naming a form
  • Click on the form to select it
  • Click on the properties box or right-click on the form
  • Click on the NAME property to select it (scroll through the list to locate)
  • Highlight editing part of the properties box - change name to MyFirst
  • Notice change in the properties box - caption of form has not changed



































CSCI N331 Visual Basic: n331/1_VB_Intro
15. Changing the form's caption
  • Use the same procedure to change the form's CAPTION property to {your name}'s First VB Program
  • Examine other properties of the form, but do not change them randomly



































CSCI N331 Visual Basic: n331/1_VB_Intro
16. Adding a picture box
  • Show the toolbox if hidden
  • Click on the Picture box icon (the cactus picture)
  • Drag small area on the form - this is your picture box
  • Change shape by using the '"handles"



































CSCI N331 Visual Basic: n331/1_VB_Intro
17. Picture box
  • Naming convention - pic, so name something like picBlue
  • Change background color of the box
  • Double-click on the BackColor property
  • Choose a color for your box from the palette



































CSCI N331 Visual Basic: n331/1_VB_Intro
18. Adding some code to Picture box
  • Double-click on the picture box - this brings up the code window
  • First, decide on the algorithm - then implement it



































CSCI N331 Visual Basic: n331/1_VB_Intro
19. Some concepts
  • Object oriented syntax
       - OBJECT.PROPERTY
       - sometimes FORM.OBJECT.PROPERTY
       - note the periods and lack of spaces



































CSCI N331 Visual Basic: n331/1_VB_Intro
20. Variable = value
  • Read "Variable gets value"
  • NOT equality
  • For our purposes, an object property is a variable



































CSCI N331 Visual Basic: n331/1_VB_Intro
21. Saving the program
  • VB has TWO different files for each program:
    Form has a .FRM extension
       - contains description of the form, objects and code
    Project has .VBP(Visual Basic Project) extension
       - essentially has a list of the forms in the program



































CSCI N331 Visual Basic: n331/1_VB_Intro
22. Use the Disk icon to save
  • This is the safest way to be sure everything is saved
  • Look at the default name given and ALWAYS use the same extension
  • If you are confused, use NO extension at all
  • VB will guess better than you



































CSCI N331 Visual Basic: n331/1_VB_Intro
23. Test the program
  • Press the Play button on the toolbar - you will see your program running
  • Click on the form outside the box, nothing should happen
  • Click inside the box, the window should change colors
  • Hit the stop button to return



































CSCI N331 Visual Basic: n331/1_VB_Intro
24. Save the program
  • Test and save the program

    HAVE FUN!



































outline

Purpose of the class

What we are learning

Why program?

Hardware information

Computer requirements

Solving problems with STAIR

History of programming

Birth of programming languages

Higher level languages

Windows-general characteristics

Programming differences-DOS

Programming differences-WINDOWS

Visual Basic Guided Tour

Naming a form

Changing the form's caption

Adding a picture box

Picture box

Adding some code to Picture box

Some concepts

Variable = value

Saving the program

Use the Disk icon to save

Test the program

Save the program