22
1 1 Lab1 Lab1 Ismail M. Romi – IT Dept , PPU, 2010

1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

Embed Size (px)

Citation preview

Page 1: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

11

Lab1Lab1

Ismail M. Romi – IT Dept , PPU, 2010

Page 2: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

22

Visual Basic 2005Visual Basic 2005

Programming TourProgramming Tour

Page 3: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

3

Structure of a VB Application (Project)1. Project: A collection of files.

2. Solution: a collection of projects

3. Forms: Windows that you create for user interface.

4. Controls: Objects drawn on the form to allow user interaction.

5. Properties: Characteristics of forms and objects.

3

Page 4: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

4

Structure of a VB Application (Project)… Cont.

5. Methods: Built-in procedures

6. Event Procedures: Code related to objects.

7. General Procedures: Code not related to objects.

4

Page 5: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

5

Start Page

Open existing project

Create new

project

Page 6: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

6

New Project Dialog Box

New Project Dialog Box

Project Name

Select windows

Application

Page 7: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

77

IntegratedIntegrated Development Development EnvironmentEnvironment

IIDDEE

Page 8: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

88

VB 2005 Integrated Development Environment (IDE)

Page 9: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

99

The Title Bar

The line at the top of the window which shows:

1. The project name.

2. The project status (Design, Run).

Page 10: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

1010

The Menu Bar

Note: Each menu item has it’s own pull down menu which contains another menu items.

Menu Item

Page 11: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

1111

The Tool Bar

•Contains buttons that performs specific tasks.

•To Show/Hide Tool Bar: View, Toolbars

Page 12: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

1212

The Tool Box

Copyright 2008: Ismail M.Romi, PPU. All Rights Reserved

A collection of buttons called Controls that enables you to implement the graphical user interface.

Page 13: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

1313

The Form Window

The background window that the user see during the program execution.

The forms are given a default name Form1, From2…

On the form you can place the controls from the toolbox required for the user interface.

Title Bar

Page 14: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

1414

The Solution Explorer

•A window that lists all solution projects, files

•You can use the context window to Add, Save, Remove file.

Page 15: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

1515

The Properties Window

Property Name

Property Value

Toggle to events

Toggle to properties

Control Name

Page 16: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

1616

The Properties Window Lists the properties and events of the

controls (objects). Each control and form has it’s own

properties and events. Each property consists of :

Name. Value.

You can change the values in the properties window, and this is reflected automatically on the associated Control (Object).

Page 17: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

1717

Placing Controls on the Form

Ways:

1- Double-click the control you want from the ToolBox.

2- Choose the Control from the ToolBox, assign it’s place on the from.

Page 18: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

1818

Lab1 Training

Part I: Examples

1- Design a VB project, to perform Greetings.

2- Saving the project.

Page 19: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

1919

Lab1 TrainingPart II: Questions

Question I Start VB. Close the Form, Project, Properties, and

Toolbox windows. Now perform the actions necessary to

make each window appear on-screen.

Page 20: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

2020

Lab1 Training

Question II Start a new project in VB 2005. Delete any custom controls from the project. Add three text boxes and two command buttons. Change the text property of each button, Use whatever text

you want Change the Text property of the text boxes so that they are

blank (Empty).

Page 21: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

2121

Lab1 Training

Design the greeting interface as follow:

When you click University Greeting, the message “Welcome to PPU University” will appear in the textbox.

When you click College Greeting, the message “Welcome to Adm. College” will appear in the textbox.

When you click End the program ends.

Question III

Page 22: 1 1 Lab1 Ismail M. Romi – IT Dept, PPU, 2010. 2 2 Visual Basic 2005 Programming Tour

2222

Lab1 Lab1 EndEndThank you