23
Introducing Visual Basic 3.1 to 3.8

Introducing Visual Basic 3.1 to 3.8. 3.1 The Visual Basic Programming Language 3.2 A Visual Basic Application 3.3 The Visual Basic IDE 3.4 Adding

Embed Size (px)

Citation preview

Page 1: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

Introducing Visual Basic3.1 to 3.8

Page 2: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

3.1 The Visual Basic Programming Language 3.2 A Visual Basic Application 3.3 The Visual Basic IDE 3.4 Adding Objects to a Form 3.5 Object Property Values 3.6 Resizing and Moving an Object 3.7 Saving a Project 3.8 Running a Visual Basic Application

Page 3: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

The Visual Basic Programming Language◦ Based on BASIC which was created in 1960’s by John Kemeny and

Thomas Kurtz at Dartmouth University. BASIC – Beginner’s All-Purpose Symbolic Instruction Code

Page 4: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

born: May 31, 1926 in Budapest, Hungry died: December 26, 1992 in Hanover, New Hampshire

Co-inventor of BASIC. Einstein's mathematical assistant. Leader and innovator in mathematics education. President of Dartmouth College.

Page 5: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

BASIC was invented at Dartmouth College in 1964 to give students a simple programming language that was easy-to-learn. It turned out that easy-to-learn and use was also a good idea for faculty members, staff members, and everyone else. There were very few choices for students, teachers, and others who didn't want to dedicate their lives to programming. Our programming language provided the solution and has played an important role in the field ever since. Even with all the new languages introduced since then, BASIC use continues to grow

Page 6: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

1975 Bill Gates and Paul Allen developed a version of BASIC.

Founder of Microsoft◦ QuickBasic created by Microsoft.

Microsoft combined Rudy and Basic to get Visual Basic.

Page 7: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

Object Oriented Programming Uses classes, which are program code and data, to create objects. Objects- can have visual representation such as a dialog box,

button etc. Event-driven program – when a program runs due to an object

being selected by the user.

Page 8: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

Application – another name for a program. Interface – is what appears on the screen when the

application is running. Program Code – is instructions that tells an application’s

objects how to behave.

Page 9: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

IDE – Integrated development environment.◦ Used to create a Visual Basic application

The Visual Basic IDE consists of:◦ Menu Bar◦ Tool Bar◦ Tool Box◦ Project Window◦ Project Explorer Window◦ Properties Window◦ Form Layout Window

Page 10: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding
Page 11: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

Menu Bar Tool Bar Project Window Project Explorer Window Properties Window Form Layout Window

Page 12: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

Form – is a container object for other objects

Page 13: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

Objects are added during design time The time during which the applications interface is

being created. Label object is used to display information. Command Button object is something a user can

click on. Objects are added by clicking and moving your

mouse over to the screen and dragging it across the form.

Page 14: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

Properties – defines its appearance, behavior, position, and other attributes.

Each type of objects have many different types of properties.

Page 15: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

Name – identifies an object all names should start with the prefix “lbl”.

Caption – changes the text displayed in the label Font – used to change font style, and size. Alignment – Changes the alignment of text in a label’s

caption (left & right justify and center)

Page 16: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

Name – identifies the object. Prefix “cmd” Caption – Changes the text displayed in the command

button.

Page 17: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

Name – identifies an object. Prefix “frm” Caption – changes the text displayed in the title bar.

Page 18: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

When naming an object, it should start with the appropriate prefix and then be descriptive of the object’s purpose.

Page 19: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

Selecting an object is done by simply clicking on it. Resizing by using the drag handle Marquee Selection – Selecting the pointer control and

create a dash box around several objects at one time.

Page 20: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

File menu and select the “Save Project” command or clicking on disk icon shortcut key.

First saved – both form and project must be given descriptive names.◦ Save the form using the same name as its Name Property

and then save the project using a descriptive name of the application.

Page 21: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

F5 – start command Run Menu and select run Run icon on the toolbar

Page 22: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

Refers to the time during which application is being executed.

A VB program can be run at any time of its development.

Page 23: Introducing Visual Basic 3.1 to 3.8.  3.1 The Visual Basic Programming Language  3.2 A Visual Basic Application  3.3 The Visual Basic IDE  3.4 Adding

Run Menu – select “End” command. Click the End icon on the Tool Bar.