Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Introduction to Visual Basic Dr Mohd Nabil Almunawar MS 3403 Advanced Computing.

Similar presentations


Presentation on theme: "1 Introduction to Visual Basic Dr Mohd Nabil Almunawar MS 3403 Advanced Computing."— Presentation transcript:

1 1 Introduction to Visual Basic Dr Mohd Nabil Almunawar MS 3403 Advanced Computing

2 2 Learning Objectives  Describe visual and event-driven programming  Explain concepts of objects, properties, and methods  List and describe the three steps for writing Visual Basic project  Identify the elements in the Visual Basic environment

3 3 High-Level Language  Procedural languages : the main concern is processes. The program specifies the exact sequence of all operations through sub-programs called procedures or functions.  Object-oriented languages : the main concern is objects which are the integration of processes and data.  Visual languages: can be any language (procedural or object-oriented) equipped with visual tools to design and create programs.  Event-driven programming : Each event (mouse, keyboard, any input device) will trigger a procedure/function.

4 4 The Object Model  An object is an integration of data (properties) and operations Object’s name Properties (data) Operations

5 5  In object model (object-oriented), everything is an object.  Properties are attributes of an object such as name, colour, size, caption, location, etc.  Operations are processes or actions provided by an object. Operations can access or modify properties. Examples: move, print, resize, display, ChangeColour, etc.  A method is an implementation of an operation.  If a message is sent to an object then a corresponding method will be activated.

6 6 HelloForm BackColour Caption Font... Move Resize Show... BoardLabel Caption ForeColour FontSize... Display ChangeFontSize... Display BoardLabel.Display(“Hello World”)

7 7 Writing Visual Basic Projects Design the user interface draw sketch of user interface screen. Consult with user about this interface Plan the properties For each object, write down the properties that you plan to set or change Plan Programming Plan the Basic Code use flow chart or pseudocode to describe processes/actions/events

8 8 Visual Basic Environment Main VB window Toolbox Form windowMenu bar Toolbar Project explorer window Properties window Properties help Pane Form layout window

9 9 VB Toolbox Pointer Label Frame Check box Combo box Horizontal scroll bar Timer Folder list box Shape Image Picture box Text box Command button Option button List box Vertical scroll bar Drive list box File list box Line Data

10 10 VB Object Naming Convention Object class Form Command Button Text Box Label Option button Check box Frame Horizontal scroll bar Vertical scroll bar Image Picture box Combo box List box Shape Prefix frm cmd txt lbl opt chk fra hsb vsb img pic cbo lst shp Example frmDataEntry cmdExit txtPaymentAmount lblTotal optBold chkPrintSummary fraSelection hsbRate vsbTemperature imgLogo picLandScape cboBookList lstIngredients shpBox

11 11 Exercise  Using the VB programming guideline (writing VB project), design and implement the following simple program.  Write a project that display a message taken from an input box in a label. You have to provide the following functions:  Display the message and at the same time clear the input box  Increase the font size of the message  Decrease the font size of the message  Exit from the program


Download ppt "1 Introduction to Visual Basic Dr Mohd Nabil Almunawar MS 3403 Advanced Computing."

Similar presentations


Ads by Google