Introducing Visual Basic 3.1 to 3.8. 3.1 The Visual Basic Programming Language 3.2 A Visual Basic...

Post on 01-Jan-2016

239 views 2 download

Tags:

Transcript of Introducing Visual Basic 3.1 to 3.8. 3.1 The Visual Basic Programming Language 3.2 A Visual Basic...

Introducing Visual Basic3.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 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

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

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.

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

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.

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.

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.

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

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

Form – is a container object for other objects

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.

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

Each type of objects have many different types of properties.

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)

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

button.

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

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

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.

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.

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

Refers to the time during which application is being executed.

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

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