Visual Basic.

Slides:



Advertisements
Similar presentations
Information System Design Lab 5&6. User Interface Design.
Advertisements

CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
Introduction to Visual Basic Programming. Lecture Outline History What is Visual Basic First Look at the VB 6.0 Environment Some VB Terminology Our first.
Visual Basic Project Files:.VBP file: Project File: a small text file that contains the names of other files in the project, as well as some information.
Introduction to computers & Visual Basic School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Monday 1/27/2003)
Introduction to Visual Basic What it is, and a simple program Mike Thelwall University of Wolverhampton, UK.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Visual Basic.net IDE. Integrated Development Environment.
Visual Basic Chapter 1 Mr. Wangler.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
An Introduction to Visual Basic
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
IE 411/511: Visual Programming for Industrial Applications
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
Appendices A - F A-F Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Introduction It is developed to create software applications. It is a tool for developers of any program that uses both basic and expert settings. It.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
CHAPTER TWO INTRODUCTION TO VISUAL BASIC © Prepared By: Razif Razali 1.
Chapter Two Creating a First Project in Visual Basic.
CC111 Lec7 : Visual Basic 1 Visual Basic(1) Lecture 7.
Chapter 2 – Introduction to the Visual Studio .NET IDE
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
Integrated Development Environment Visual Basic IDE Slide 2 of 10 Topic & Structure of the lesson Introduction Integrated Development Environment Tool.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
Controls. Common properties Height – Height of the control Left – Left of the control Width – width of a control Top - From the screen top Font – Foreground.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
TOOLBOX. The Toolbox Intrinsic Controls - always included in the Toolbox ActiveX Controls - separate files with ocx file extension Insertable Objects.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Dive Into® Visual Basic 2010 Express
VISUAL BASIC 6.0 Designed by Mrinal Kanti Nath.
Visual Basic.NET Windows Programming
Chapter 2: The Visual Studio .NET Development Environment
Working in the Forms Developer Environment
Chapter 1: An Introduction to Visual Basic 2015
Visual Basic Code & No.: CS 218
Introduction to Computer CC111
Chapter Topics 15.1 Graphical User Interfaces
Introduction to Computing
Chapter 2 – Introduction to the Visual Studio .NET IDE
An Introduction to Computers and Visual Basic
3.01 Apply Controls Associated With Visual Studio Form
1. Introduction to Visual Basic
Visual programming Chapter 1: Introduction
3.01 Apply Controls Associated With Visual Studio Form
An Introduction to Computers and Visual Basic
VB 6.0.
Visual Basic Project Development Environment
VISUAL BASIC.
Chapter 2 – Introduction to the Visual Studio .NET IDE
CIS16 Application Development Programming with Visual Basic
Визуалды бағдарламалау ортасы.
P.J.Balakumaran, AP, Commerce CA, SNMV CAS
Working with Symbols and Interactivity
Visual Studio.
An Introduction to Computers and Visual Basic
Chapter 15: GUI Applications & Event-Driven Programming
Chapter 4 Enhancing the Graphical User Interface
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

Visual Basic

Introduction to Visual Basic VISUAL BASIC is a high level programming language evolved from the earlier DOS version called BASIC. BASIC stands for Beginners' All-purpose Symbolic Instruction Code The program codes in Visual Basic resemble the English language Different software companies produce different versions of BASIC, such as Microsoft QBASIC, QUICKBASIC, GWBASIC, and IBM BASICA and so on. VISUAL BASIC is a VISUAL and events driven Programming Language

Divergences from the old BASIC. VISUAL BASIC Programming is done in a text-based environment and the program is executed sequentially. Programming is done in a graphical environment. Text-based procedure to design the interface Design the interface by dragging and resizing the objects as well as changing their colors, just like any windows-based programs. Visual Basic is event-driven because users may click on a certain object randomly, so each object has to be programmed independently to be able to response to those actions (events). Examples of events are clicking a command button, entering text into a text box, selecting an item in a list box etc. Therefore, a VISUAL BASIC Program is made up of many subprograms; each with its own program code which can be executed independently and at the same time can be linked together in one way or another.

The Visual Basic Environment

The Visual Basic Environment

The Visual Basic Environment a- Menu Bar: It contains a standard command like: File, Edit, View, Window, Help menus, and specific command such as: Project, Format, or Debug menus. b- Toolbar: it contains the most commonly used commands (button), if clicked an action represented by that button is carried out. c- Toolbox: it contains a collection of tools that are needed for project design. d- form Designer: it is a window for each form to customize the designed interface of the application. Using the form designer, the user can add controls, graphics, and text to create the desired form appearance. e- Properties Window: it is a List of properties settings for a selected form or a control. These properties are characteristics (such as size, visible, or color) of the selected object it provides an easy way to set properties.

The Visual Basic Environment f- Project Explorer Window: it is a list of the forms and modules for the current projects. lt is a hierarchical tree- branch structure, where the project at top of tree and other parts like forms ,modules) descend from this tree. g- Form Layout Window: The Form Layout window is a small screen. Which is used to reposition the form of the application so that it appears in proper place when project is run. h- Code Editor Window: Code Editor Window is used to write a VB code for an application. For each form there is a separate code editor window. It is displayed when user clicks on form or object in form.

The controls available for a Standard.exe project The toolbox includes many tools and in general they are: 1) Pointer (not control) : used to select tools already on form 2) Picture box : Used to display images in any of the following formats: BMP, DIB (bitmap), ICO (icon), CUR (cursor), WMF, (metafile), EMF (enhanced metafile), GIF, and JPEG. 3) Label : Fixed text appears on form for remark. 4) Textbox : For text edit .Like note pad. 5) Frame : To group tools together (container). 6) Command button : Used as a switch (such as OK and Cancel) buttons. Code is written in the Click event procedure of this control 7) Check box : For a yes/ no (true /false) selection.

The controls available for a Standard.exe project 8) Option button : For selection as group. Many options are placed inside container (grouped) (a Frame control). One control is selected from the group all others of the group are automatically deselected. 9) Combo box : consists of (list and arrow when clicked a small a list appears), if user selects item from the list, it will be displayed in TextBox. Vertical size is fixed. 10) List box : For a list, user adds to and deletes from this list. It takes any size. 11) Horizontal Scrollbar : Create stand-alone Horizontal scroll bars. 12) Vertical Scrollbar : Create stand-alone vertical scroll bars. 13) Timer : Used to control object movement.

The controls available for a Standard.exe project 14) Drive List Box : It is a special ListBox filled automatically with names, of the files in a specified directory. It is a list invariant. 15) Dir List Box : It is a special ListBox filled with drives (Hard disc, Flopy, CD) in the system. It is an invariant. 16) File List Box : It is a special ListBox filled automatically with the names of all DirListBox. It is a list invariant. 17) Shape : Used only to display rectangles, circles, and ovals on the forms. Never raises any events 18) Line :Used only to display lines on the forms. It never raises any events. 19) Image : Used instead of PictureBox because it consumes fewer system resources. 20) Data : used for data base. 21) OLE : used for joining with another programs.

The controls available for a Standard.exe project 14) Drive List Box : It is a special ListBox filled automatically with names, of the files in a specified directory. It is a list invariant. 15) Dir List Box : It is a special ListBox filled with drives (Hard disc, Flopy, CD) in the system. It is an invariant. 16) File List Box : It is a special ListBox filled automatically with the names of all DirListBox. It is a list invariant. 17) Shape : Used only to display rectangles, circles, and ovals on the forms. Never raises any events 18) Line :Used only to display lines on the forms. It never raises any events. 19) Image : Used instead of PictureBox because it consumes fewer system resources. 20) Data : used for data base. 21) OLE : used for joining with another programs.

Introduction to Visual Basic

list of objects

list of procedures

Displaying the output Private Sub Form_Activate () A = "Tom " B = “likes " C = “to " D = “eat " E = “burgers." Print A & B & C & D & E End Sub +or the & operator to join two or more texts (string).

Summation of values using textbox, label, command button Private Sub Command1_Click() 'To add the values in TextBox1 and TextBox2 Sum = Val(Text1.Text) +Val(Text2.Text) 'To display the answer on label 1 Label1.Caption = Sum End Sub

Operators in Visual Basic Arithmetical Operators Operators Description Example Result + Add 5+5 10 - Substract 10-5 5 / Divide 25/5 \ Integer Division 20\3 6 * Multiply 5*4 20 ^ Exponent (power of) 3^3 27 Mod Remainder of division 20 Mod 6 2 & String concatenation "George"&" "&"Bush" "George Bush"

Operators in Visual Basic Relational Operators Operators Description Example Result > Greater than 10>8 True < Less than 10<8 False >= Greater than or equal to 20>=10 <= Less than or equal to 10<=20 <> Not Equal to 5<>4 = Equal to 5=7

Operators in Visual Basic Logical Operators Operators Description Example AND Compare two variables if a AND b equals If x AND y ThenEnd If OR Compare two variables if a OR b equals If x or y Then End If