Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to computers & Visual Basic School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Monday 1/27/2003)

Similar presentations


Presentation on theme: "Introduction to computers & Visual Basic School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Monday 1/27/2003)"— Presentation transcript:

1 Introduction to computers & Visual Basic School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Monday 1/27/2003)

2 2 Learning Objectives n Overview of some computer-related things you should know n Introduction to Visual Basic

3 3 Windows vs. windows Windows desktop

4 4 Windows vs. windows Menu bar Toolbar Title bar Work area Scroll bar Scroll box Minimize button Maximize button Close button Scroll box Scroll bar

5 5 What you should know 1.Which of the following is NOT a main component of a personal computer? (A)Microprocessor (B)Diskette drive (C)Keyboard (D)Modem (E)Monitor 2.The data used by a program do not normally come from the (A)diskette. (B)user. (C)screen. (D)program.

6 6 What you should know 3.Which one of the following is a toggle key? (A)Alt (B)Ctrl (C)Num Lock (D)Shift (E)None of the above 4.Which key is used to move within a dialog box? (A)Space key (B)Tab key (C)Esc key (D)A cursor key

7 7 What you should know 5.What is wrong with the file specification “C:/SPORTS/TENNIS.DOC”? 6.What is the difference between a folder and a directory? 7. In Windows 95 and 98, a file name can be no longer than (A)25 characters. (B)8 characters plus 3 characters for the file extension. (C)255 characters. (D)2550 characters. 8. Explain why “FOUR STAR HOTEL ****” is not a valid file name.

8 8 What you should know 9. Suppose the specification of a file is “A:\ANIMAL\BIRDS\ROBIN.DOC”. How many folders must you opened in My Computer to reach the file ? 10. Distinguish between System Software and Application Software. http://www.totalsem.com/files/Essential_Windows.pdf Get more at:

9 9 Visual Basic ? n BASIC stands for Beginner’s All-purpose Symbolic Instruction Code. n Visual Basic (for Windows) was developed in 1991 by the Microsoft Corporation. n Used to create Windows applications n Provides Graphical User Interface n Event-driven programming language

10 10 Event-driven n Code remain idle until called upon to respond to events n “Nothing” happens until an event is detected n VB governed by an Event processor Event? Event processor Basic Code Basic Code Basic Code Event Procedures

11 11 Example of Visual Basic application Private Sub cmdValid_Click() Dim Response As Integer If txtPassword.Text = txtPassword.Tag Then MsgBox "You've passed security!", vbOKOnly Else Response = MsgBox("Incorrect password", vbRetryCancel + vbCritical, "Access Denied") End If txtPassword.SetFocus End Sub

12 12 Structure of a VB application Control 1 Control 3 Control 2 Form 3 (.FRM) Module 1 (.BAS) Control 1 Control 3 Control 2 Form 2 (.FRM) Control 1 Control 3 Control 2 Form 1 (.FRM) Project (.VBP)

13 13 VB application (project) n Forms - Windows that you create for user interface n Controls - Graphical features drawn on forms to allow user interaction (text boxes, labels, scroll bars, command buttons, etc.) (Forms and Controls are objects.) n Properties - Every characteristic of a form or control is specified by a property. Example properties include names, captions, size, color, position, and contents. Visual Basic applies default properties. You can change properties at design time or run time. n Methods - Built-in procedure that can be invoked to impart some action to a particular object. n Event Procedures - Code related to some object. This is the code that is executed when a certain event occurs. n General Procedures - Code not related to objects. This code must be invoked by the application. n Events – Actions initiated by the user or the computer itself. In case of an event, the VB Event Processor activate the appropriate Event procedure.

14 14 Steps to Developing VB application 1. Draw the user interface by placing controls on the form(s) 2. Assign properties to controls 3. Attach code to control events (and perhaps write other procedures)

15 15 Steps to Developing VB application Initial Visual Basic Screen Main window Form window Toolbox Project window Properties window Form Layout window

16 16 Drawing the User Interface n VB operates in 3 modes: – Design mode – Run mode – Break mode n User Interface drawn in Design mode using : – Form window (Where you draw your application) – Toolbox (Where you select controls) – Properties window (Used to establish initial property values for objects (controls) – Main window (for many usual operations)

17 17 Drawing the User Interface n The Form window is central to developing application Pointer Label Frame Check Box Combo Box Horizontal Scroll Bar Timer Directory List Box Shapes Image Box Object Linking Embedding Picture Box Text Box Command Button Option Button List Box Vertical Scroll Bar Drive List Box File List Box Lines Data Tool The Toolbox

18 18 Drawing the User Interface The Properties Window Two views are available: Alphabetic and Categorized. Under this box are the available properties for the currently selected object. Help with any property can be obtained by highlighting the property of interest and pressing. The drop-down box at the top of this window lists all objects in the current form.

19 19 Drawing the User Interface Main Visual Basic window New form Add project Open project Save project Menu editor Properties window Code Editor Tasks Form Layout Run Pause Stop Project Explorer Object Browser Toolbox Form position Form dimensions

20 20 Summary Questions 1. Explain why VB is an event-driven programming language ? 2. Name the steps to develop a VB application 3. (a) Name VB modes of operation. (b) In which mode User interfaces are drawn ?


Download ppt "Introduction to computers & Visual Basic School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Monday 1/27/2003)"

Similar presentations


Ads by Google