Download presentation
Presentation is loading. Please wait.
Published byDamon Allan Burke Modified over 9 years ago
1
CC111 Lec7 : Visual Basic 1 Visual Basic(1) Lecture 7
2
CC111 Lec7 : Visual Basic 2 Objectives The student should be familiar with the Visual Basic Environment. The student should be able to build a simple Visual Basic Application.
3
CC111 Lec7 : Visual Basic 3 What is Visual Basic? High Level 4th Generation Programming Language Object and Event Driven Visual - Windows Based Integrated Development Environment or IDE
4
CC111 Lec7 : Visual Basic 4 What is VB Used For? Most Popular Programming Language Stand alone programs Customized specialized Applications –E- Commerce Web based shopping forms and inquiries User friendly Interface to applications
5
CC111 Lec7 : Visual Basic 5 Used by a computer equipment retail outlet to record data regarding customer orders. Example Order Entry Screen Allows user to use a mouse to click on boxes for text entry. Also enables user to click on buttons to initiate processing steps.
6
CC111 Lec7 : Visual Basic 6 Generations of Computer Languages 1st - Machine language - 0110 0011 1000 2nd - Procedure-oriented languages –FORTRAN - 1954 for scientists and engineers –COBOL - 1959 for business applications –C - 1972 - for UNIX operating systems 3rd - Object-oriented languages 4th - Event-driven languages. Example:VB 5th - Natural languages
7
CC111 Lec7 : Visual Basic 7 Compiler Vs Interpreter Higher Languages are translated to Machine Language by: –Interpreter Translates instructions to machine code line-by-line. BASIC, Quick Basic, Visual Basic –Compiler Translates the entire program to machine code before running it. Fortran, C, C++, Visual Basic is also a compiler
8
CC111 Lec7 : Visual Basic 8 What are the Objects in VB? Pre-programmed Code for: –Command Buttons –Labels –Pictures –Text Boxes Have both data and procedures wrapped together
9
CC111 Lec7 : Visual Basic 9 What is the Integrated Development Environment (IDE)?
10
CC111 Lec7 : Visual Basic 10 Visual Basic Environment GUI (Graphical User Interface) - forms and windows that the user sees Property - a characteristic or attribute of an object such as color and size Event - a user action such as clicking a button Code Editor window - editor specially designed to help you when writing code
11
CC111 Lec7 : Visual Basic 11 The Form Designer Window show the GUI application The Toolbox is used to drag and drop components to your forms The Properties window show the value od of the properties of each selected component(Object) Visual Studio 2008 IDE Environment
12
CC111 Lec7 : Visual Basic 12 Visual Basic Environment Components of the VB design environment (Form view)
13
CC111 Lec7 : Visual Basic 13 Visual Basic Environment Components of the VB design environment (Code view)
14
CC111 Lec7 : Visual Basic 14 The Code Editor Window Help window Error message box Syntax error in Red
15
CC111 Lec7 : Visual Basic 15 Properties Window Used to set how a control looks and behaves Holds its default values
16
CC111 Lec7 : Visual Basic 16 Control Toolbox Pointer Label Group Frame Check Box Combo Box Horizontal Scroll Bar Timer Directory List Box Shape Image OLE Picture Text Box Command Button Option/Radio Button List Box Vertical Scroll Bar Drive List Box File List Box Line Data Control
17
CC111 Lec7 : Visual Basic 17 Building Your First Application There are three primary steps in building a Visual Project: 1.Place (or draw) controls on the form. 2.Assign properties to the controls. 3.Write event procedures for the controls. WelcomeApplication.exe
18
CC111 Lec7 : Visual Basic 18 Starting Visual Basic
19
CC111 Lec7 : Visual Basic 19 Starting Visual Studio 2008
20
CC111 Lec7 : Visual Basic 20 Creating New Project
21
CC111 Lec7 : Visual Basic 21 Project initial interface
22
CC111 Lec7 : Visual Basic 22 Step1 :Draw your controls
23
CC111 Lec7 : Visual Basic 23 Step 2 : Assign Properties
24
CC111 Lec7 : Visual Basic 24 Changing the Form Title
25
CC111 Lec7 : Visual Basic 25 Changing the Form Title……………
26
CC111 Lec7 : Visual Basic 26 Edit Image Properties
27
CC111 Lec7 : Visual Basic 27 Browse for an Image
28
CC111 Lec7 : Visual Basic 28 Edit the SizeMode property of the PictureBox
29
CC111 Lec7 : Visual Basic 29 Edit the Text Property of Label1 The Text Property is changed to “ “
30
CC111 Lec7 : Visual Basic 30 Accessing components properties from code Label1 PictureBox1 Button1 Each Component has a name, you access its property by: componentName.PropertyName
31
CC111 Lec7 : Visual Basic 31 Step 3:Writing the Code (Events) Double click on the Button then write your code
32
CC111 Lec7 : Visual Basic 32 Writing the Code (Events)
33
CC111 Lec7 : Visual Basic 33 Running the Application
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.