Mark Dixon, SoCCE SOFT 131Page 1 16 – Visual BASIC 6.0.

Slides:



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

CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Chapter 1: An Introduction to Visual Basic 2012
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Mark Dixon, SoCCE SOFT 131Page 1 22 – Visual BASIC 2005.
Mark Dixon, SoCCE SOFT 136Page 1 05 – Conditional Execution.
Mark Dixon, SoCCE SOFT 136Page 1 02 – Software Development Life-Cycle.
Mark Dixon, SoCCE SOFT 131Page 1 20 – Web applications: HTML and Client-side code.
Mark Dixon, SoCCE SOFT 131Page 1 03 – User Interface Design, and Sound and Graphics.
Mark Dixon Page 1 02 – Dynamic HTML (client-side scripting)
Mark Dixon, SoCCE SOFT 131Page 1 03 – Debugging & Graphics.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Software Development Lifecycle, & User Interface Design.
Slide 1 ICS 012 Visual Programming I Ahmed Esmat Second.
Mark Dixon, SoCCE SOFT 131Page 1 13 – Control Arrays & Container Controls.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Mark Dixon, SoCCE SOFT 131Page 1 03 – Debugging, Sound, and Graphics.
Mark Dixon, SoCCE SOFT 131Page 1 SOFT – Module Introduction & Overview.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Software Development Lifecycle, & User Interface Design.
Mark Dixon, SoCCE SOFT 131Page 1 08 – Web applications: HTML and ActiveX controls.
®® Microsoft Windows 7 Windows Tutorial 1 Exploring the Basics of Microsoft Windows 7.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
Visual Basic Chapter 1 Mr. Wangler.
Chapter 3 Working with Symbols and Interactivity.
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 TWO Creating Simple Visual Basic.NET Windows Applications.
1 1 Lab1 Ismail M. Romi – IT Dept, PPU, Visual Basic 2005 Programming Tour.
Appendices A - F A-F Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 2 The Visual Basic.NET Integrated Development Environment.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Integrated Development Environment (IDE)
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Dynamic HTML (client-side scripting)
Irwin/McGraw-Hill © The McGraw-Hill Companies, Inc., Visual Basic Projects Project Structure and VB’s Programming Tools chapter TWO.
Copyright © 2001 by Wiley. All rights reserved. Chapter 2: Using Visual Basic to Create a First Project Getting Started with VB Development Environment.
 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.
Chapter Two Creating a First Project in Visual Basic.
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
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Visual Basic CDA College Limassol Campus Lecture:Pelekanou Olga Semester C Week - 1.
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.
Mark Dixon 1 9 – Case Study. Mark Dixon 2 Session Aims and Objectives Aims –To give an overview of the development of a web-page from initial idea to.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
COMPUTER III. Fundamental Concepts of Programming Control Structures Sequence Selection Iteration Flowchart Construction Introduction to Visual Basic.
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.
Programming with Microsoft Visual Basic 2012 Chapter 1: An Introduction to Visual Basic 2012.
Chapter 2: The Visual Studio .NET Development Environment
Introduction to Computer CC111
Chapter 2 – Introduction to the Visual Studio .NET IDE
An Introduction to Computers and Visual Basic
Visual Basic.
Social Media And Global Computing Introduction to Visual Studio
Chapter 2 – Introduction to the Visual Studio .NET IDE
Understanding the Visual IDE
Working with Symbols and Interactivity
An Introduction to Computers and Visual Basic
Presentation transcript:

Mark Dixon, SoCCE SOFT 131Page 1 16 – Visual BASIC 6.0

Mark Dixon, SoCCE SOFT 131Page 2 Session Aims & Objectives Aims –introduce you to the fundamentals of: VB6 development environment sound, and graphics Objectives, by end of this week’s sessions, you should be able to: –develop 'stand alone' applications –put bitmap (raster) graphics into your applications –draw simple vector graphics in your applications –play MP3 and WAV files in your applications

Mark Dixon, SoCCE SOFT 131Page 3 VB6 IDE Microsoft Visual BASIC 6.0 IDE: Integrated Development Environment –Screen (form) designer –Code editor –Debugger –Help Start menu, Programs, University Software, M, Microsoft Visual Studio 6.0

Mark Dixon, SoCCE SOFT 131Page 4 VB6 IDE: Save Project (properly) 1.Click Save button 2.Create New Folder 3.Save: –project file (.vbp) –form files (.frm)

Mark Dixon, SoCCE SOFT 131Page 5 VB6 IDE: Screen (Form) Designer Drag and Drop Controls from the ToolBox onto the Form, & change properties

Mark Dixon, SoCCE SOFT 131Page 6 VB6 IDE: Code Editor Type code into the code window

Mark Dixon, SoCCE SOFT 131Page 7 Run your program (F5), or Step through line by line (F8) Immediate Window: code executed immediately VB6 IDE: Debugger Run Pause Stop

Mark Dixon, SoCCE SOFT 131Page 8 Version Control: Copy Folder At regular intervals use Windows Explorer to copy whole folder to create new version –drag the folder and hold down CTRL key

Mark Dixon, SoCCE SOFT 131Page 9 Version Control: Rename Folder Rename the copy of the folder, using the date and time it was created:

Mark Dixon, SoCCE SOFT 131Page 10 Software Development Cycle Software development follows this pattern: –analyse problem –design solution –implement (code) solution –test & debug solution (code) However, it is: –cyclic/iterative (not linear)

Mark Dixon, SoCCE SOFT 131Page 11 Example: PicView - Analysis SPECIFICATION User Requirements –display photos quickly and easily one after another Software Requirements –Functional: –change current folder and drive –display list of picture files in current folder –display picture (*.jpg, *.bmp, and *.gif) from files in current folder –Non-functional should be quick and easy to use PicView

Mark Dixon, SoCCE SOFT 131Page 12 Types of Graphics: Raster Raster graphics – made of dots (pixels – picture elements) –stored in.jpg,.bmp, and.gif files (picture property) –suitable for complex, static pictures (e.g. photos) –difficult to change programmatically –loses quality when enlarged:

Mark Dixon, SoCCE SOFT 131Page 13 Types of Graphics: Vector Vector graphics – made of objects (lines, circles, etc.) –not available in VB Script or HTML –suitable for simple, dynamic pictures (diagrams) –No loss of quality when enlarged

Mark Dixon, SoCCE SOFT 131Page 14 Controls Picture Box: display pictures Drive List Box: allow user to select disk drive Directory List Box: allow user to select folder File List Box: allow user to select file

Mark Dixon, SoCCE SOFT 131Page 15 Controls' Properties Picture Box (pic) –Picture: allows display of bitmap (raster graphic) as background Drive List Box (drv) –Drive: the currently selected disk drive Directory List Box (dir) –Path: the currently selected directory (folder) File List Box (fil) –Path: the currently selected folder/directory –Pattern: only display this type of file (e.g..jpg) –FileName: the currently selected file

Mark Dixon, SoCCE SOFT 131Page 16 Example: PicView - Design User interface design: Functional design: Trigger (when)Actions (what) click event of Drive Boxmake drive current (directory box points to this drive) click event of Directory Boxmake folder current (file box points to this folder) click event of File Boxdisplay selected picture in picture box

Mark Dixon, SoCCE SOFT 131Page 17 Example: PicView - Code Option Explicit Private Sub drvMain_Change () dirMain.Path = drvMain.Drive End Sub Private Sub dirMain_Change () filMain.Path = dirMain.Path End Sub Private Sub filMain_Click () picMain.Picture = LoadPicture(filMain.Path & "\" & filMain.FileName) End Sub drvMain dirMain picMain filMain

Mark Dixon, SoCCE SOFT 131Page 18 Vector Graphics: Grid System the origin (position 0,0) is at top left –in mathematics it is always bottom left

Mark Dixon, SoCCE SOFT 131Page 19 Picture Box: Drawing Methods Methods (vector graphics) –Line: draws a straight line between 2 points –Circle: draws a circle –PSet: draws a dot (point) –Cls: clears (screen) drawing area

Mark Dixon, SoCCE SOFT 131Page 20 Example: Shapes Form and Picture Box control support graphics methods: picDisplayArea.Line (500, 200)-(1900, 800) picDisplayArea.Line -(2600, 600) picDisplayArea.Line -Step(-600, -400) picDisplayArea.PSet (1500, 1000) picDisplayArea.Circle (700, 900), 300 Shapes

Mark Dixon, SoCCE SOFT 131Page 21 Example: StickMan Enabled property (true or false) StickMan

Mark Dixon, SoCCE SOFT 131Page 22 Example: Face Face

Mark Dixon, SoCCE SOFT 131Page 23 Example: Music Player - Analysis User Requirement: –to play different music for long time without interruption, at same location (while working or at party) Software Requirements Specification software should: –allow user to: select track (MP3 file) from folder on disk play selected track –automatically move to next track in folder go back to first after last has played later lecture

Mark Dixon, SoCCE SOFT 131Page 24 Additional Controls VB has hundreds of controls To include additional controls in your project: –Project menu –Components item Multimedia Control –plays MP3 & WAV files

Mark Dixon, SoCCE SOFT 131Page 25 Multimedia Controls' Properties Multi-media Control –FileName: name of file to play –Command: controls playback

Mark Dixon, SoCCE SOFT 131Page 26 Example: Music Player - Design Compare the following User Interface Designs: V0 V1

Mark Dixon, SoCCE SOFT 131Page 27 Example: Music Player - Code Option Explicit Private Sub drvMain_Change() dirMain.Path = drvMain.Drive End Sub Private Sub dirMain_Change() filMain.Path = dirMain.Path End Sub Private Sub filMain_Click() mmcMain.Command = "Close" mmcMain.FileName = filMain.Path & "\" & filMain.FileName mmcMain.Command = "Open" End Sub drvMaindirMain filMainmmcMain

Mark Dixon, SoCCE SOFT 131Page 28 Example: Face v2 Face

Mark Dixon, SoCCE SOFT 131Page 29 Tutorial Exercise: PicView Task 1: Get the PicView example (from the lecture) working. Task 2: Get the StickMan example (from the lecture) working. Task 3: Get the Music Player example (from the lecture) working. Task 4: Modify your program to automatically go the next track after the current one ends. Task 5: Modify your program to automatically go the first track after the last one ends. Task 6: Get the Face v2 example (from the lecture working).