Introduction to Visual Basic What it is, and a simple program Mike Thelwall University of Wolverhampton, UK.

Slides:



Advertisements
Similar presentations
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Advertisements

CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Microsoft Word 2013 An Overview. Your Environment Quick Access Toolbar Customizable toolbar for one-click shortcuts Tabs Backstage View Tools located.
Excel Lesson 1 Microsoft Excel Basics
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.
Automating Tasks With Macros
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.
 2002 Prentice Hall. All rights reserved. Chapter 2 - Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Overview of the Visual Studio.NET.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
Introduction to Computing Dr. Nadeem A Khan. Lecture 11.
Introduction to computers & Visual Basic School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Monday 1/27/2003)
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Developing Software Applications Bob Hobbs
A Tour of Visual Basic BACS 287. Early History of Basic Beginners All-Purpose Symbolic Instruction Code An “Interpreted” teaching language English-like.
Introduction to Visual Basic Chulantha Kulasekere.
Introduction to Programming and Visual Basic
Access Tutorial 10 Automating Tasks with Macros
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Project 9 Using Visual Basic for Applications (VBA) to Customize and Automate Excel Jason C. H. Chen, Ph.D. Professor of Management Information Systems.
1 CA201 Word Application Increasing Efficiency Week # 13 By Tariq Ibn Aziz Dammam Community college.
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
Appendices A - F A-F Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
Creating your own form from scratch.. To create a custom form, you can modify an existing form or design and create a form from scratch. In either case,
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
A First Look At Microsoft Visual Basic Lesson 1. What is Microsoft Visual Basic? Microsoft Visual Basic is a software development tool, which means it.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Enhancing the Graphical User Interface Multiple Forms, Controls, and Menus.
Copyright © 2001 by Wiley. All rights reserved. Chapter 2: Using Visual Basic to Create a First Project Getting Started with VB Development Environment.
Chapter 3 Introducing Visual Basic
Outline Software and Programming Program Structure Tools for Designing Software Programming Languages Introduction to Visual Basic (VBA)
Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.
§Visual - A method used to create GUI applications. §BASIC - Beginner’s All - purpose Symbolic Instruction Code developed by John Kemeny. §VB- Evolved.
CHAPTER TWO INTRODUCTION TO VISUAL BASIC © Prepared By: Razif Razali 1.
CC111 Lec7 : Visual Basic 1 Visual Basic(1) Lecture 7.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
Chapter 2 – Introduction to the Visual Studio .NET IDE
CIS111 PC Literacy Getting Started with Windows XP.
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.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
Integrated Development Environment Visual Basic IDE Slide 2 of 10 Topic & Structure of the lesson Introduction Integrated Development Environment Tool.
Lesson 14: Exploring Excel Learning Objectives After studying this lesson, you will be able to:  Explain ways Excel can help your productivity.
1 Visual Basic Part I - A tool for customizing your program Principles of GIS
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
1 Introduction to Visual Basic Dr Mohd Nabil Almunawar MS 3403 Advanced Computing.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
BBT 10 Visual Basic 03 Enrichment. Tip Before creating any files for your project, first create a new folder Save all of your files in the folder Pieces.
TOOLBOX. The Toolbox Intrinsic Controls - always included in the Toolbox ActiveX Controls - separate files with ocx file extension Insertable Objects.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
XP New Perspectives on Creating Web Pages With Word Tutorial 1 1 Creating Web Pages With Word Tutorial 1.
 2007 Pearson Education, Inc. All rights reserved Introduction to the Visual Basic Express 2005 IDE.
Introduction to Computer CC111
Chapter 2 – Introduction to the Visual Studio .NET IDE
An Introduction to Computers and Visual Basic
Introduction to Computing
1. Introduction to Visual Basic
An Introduction to Computers and Visual Basic
VB 6.0.
Visual Basic.
Chapter 2 – Introduction to the Visual Studio .NET IDE
P.J.Balakumaran, AP, Commerce CA, SNMV CAS
An Introduction to Computers and Visual Basic
Lesson 1 - Automating Tasks
Chapter 4 Enhancing the Graphical User Interface
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

Introduction to Visual Basic What it is, and a simple program Mike Thelwall University of Wolverhampton, UK

Origins through BASIC  Beginners All-purpose Symbolic Instruction Code  A simple programming language  Developed mid 1960’s  Simplicity of BASIC made it a natural choice as a programming language  Most machines have own version of BASIC

Windows Programming  Visual Basic developed for Windows by Microsoft from BASIC –Interface designer –Simple coding language –Quick to produce programs  Versions of it are now also in Excel, Access, Word, PowerPoint and many other software

What is it good for?  Lots of things!  But particularly… automating repetitive tasks that are governed by strict rules  It is a relatively easy to learn language –Good for those who are not ‘real’ programmers

Designing a Program – Draw it first

VB Environment: Menu Bar  The Menu Bar consists of 3 elements the –Title Bar, which holds the name of application, default if Microsoft Visual Basic [design] –Menu Bar, this is the link to Visual Basics menu facilities, each menu option drops down into sub-menus –Toolbar, contains icons which give access to the more commonly used commands (which are also available through the menu bar) Title barMenu BarToolbar

VB Environment: Control Toolbox Pointer Label Group Frame Check Box Combo Box Horizontal Scroll Bar Timer Directory List Box Shape Image Common Dialog OLE Picture Text Box Command Button Option/Radio Button List Box Vertical Scroll Bar Drive List Box File List Box Line Data Control Grid

VB Environment: Properties Window

Events and Visual Basic  Start by drawing the screen  Then add program code for Button Clicks Trigger Event Code Executed

Visual Basic Environment

Programming Application Example  You have a large text file containing 100,000 lines, each one of which is a reference from a journal article, with details of the author  You want to count how many of these references are to SUNY Albany faculty  Visual Basic can make this task possible

Designing the Program  Open the text file  Read in the first line of text  Check if the line contains “SUNY Albany” –Keep a running total of how many matches there are  Read in the next line and repeat  Display the total count when finished

What it looks like

The code

The data nobody, no journal someone not from Albany, journal of nothing someone else not from Albany, journal of nothing john smith, SUNY Albany, Topological properties of Spheres Rong Tang, SUNY Albany, Some very hard information science nobody, no journal

The result

Visual Basic in Excel  Visual basic hides behind Excel Macros  If you know any version of VB then it is not difficult to learn the other versions  VB looks horrible in Excel programs, but can be very useful

A simple task for VB in Excel  Find the distance, in metres, between all pairs of a set of 34 US Chemistry departments  This is 1,089 distances – how can it be done?

Solution 1  Get the coordinates of each department by entering its Zip code into Multimap.com  Enter the coordinates into an Excel spreadsheet  Write a VB program to use this data to calculate the distances between all pairs of departments

The code

How to write a Visual Basic program: Plan A  Think about EXACTLY what you want to do –Can it be fully automated, or will it require human judgement?  Write down EXACTLY what you want to do –Break it into a series of steps  Take VB101 and learn VB  Write the program  Test the program to make sure that it works

How to write a Visual Basic program: Plan B [Quick Version]  Think about EXACTLY what you want to do –Can it be fully automated, or will it require human judgement?  Write down EXACTLY what you want to do –Break it into a series of steps  Find a VB programmer  Ask them to write the program for you  Test the program to make sure that it works  Buy them lunch