Lecture Roger Sutton CO331 Visual Programming 16: Timer Control 1.

Slides:



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

IS660Z Programming Games Using Visual Basic Overview of Cannonball.
Visual Basic: ballistics
COMPUTER PROGRAMMING I Objective 8.03 Apply Animation and Graphic Methods in a Windows Form (4%)
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Chapter 1: An Introduction to Visual Basic 2012
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Eight Sub and Function Procedures.
Lecture Roger Sutton CO331 Visual Programming 18: Program design 1.
Lecture Roger Sutton CO331 Visual Programming 1: Module introduction and the programming environment 1.
Chapter 1: An Introduction to Visual Basic.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Unit 2 - Importing Images Onto a Display Icon ExitNext GlossaryFinalUnit 6Unit 5Unit 4Unit 3Unit 2Unit 1IntroHome Previous Unit 2 Overview In this unit.
Introduction to Computing Dr. Nadeem A Khan. Lecture 11.
Chapter 31 Visual Basic Controls A Form is a windows-style screen displayed by Visual Basic programs. In a form, a programmer can create objects in a form.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
PictureBox, Timer, Resources. Resources An easy and effective way to add pictures (photos, graphics) to your programs Using Resources guarantees that.
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
Lecture Roger Sutton CO357 Computing for Business and Accounting 13: Automation and Control (Macros and Form controls ) 1.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
MrsBillinghurst. net A2 Computing A2 Computing Projects Game Animation in Pascal.
XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX Buttons Interactive means that the user has some level.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Click your mouse for next slide Flash – Introduction and Startup Many times on websites you will see animations of various sorts Many of these are created.
COMPUTER PROGRAMMING I Objective 8.03 Apply Animation and Graphic Methods in a Windows Form (4%)
Tutorial 1: An Introduction to Visual Basic.NET1 Tutorial 1 An Introduction to Visual Basic.NET.
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
Visual Basic Games: Week 3 Global variables, parameters, Select, KeyDown Enable, Visible, Focus State of Game Read chapter 3.
CSCI 6962: Server-side Design and Programming Introduction to Active Server Pages.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 2 Creating a User Interface.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Chapter 9 - VB.Net by Schneider1 Chapter 9 – Additional Controls and Objects 9.1 List Boxes, Combo Boxes, and the File-Opening Control The List Box Control.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
VB.NET Additional Topics
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
BIL528 – Bilgisayar Programlama II Introduction 1.
Some graphics. Projects included A slideshow a dark moon moving phases of the moon billiards Your own icons and bitmaps Pie chart.
Events with Data Arguments Data Values Travel with e.
The PictureBox Control Prefix Prefix – pic Image Property PictureBox Image Property – Changes the image or file that appears inside of the PictureBox SizeMode.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
CC111 Lec7 : Visual Basic 1 Visual Basic(1) Lecture 7.
Chapter 2 – Introduction to the Visual Studio .NET IDE
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.
CS 101 Test 2 Study Guide Acronyms RAD - Rapid Application Development IDE - Integrated Development Environment GUI - Graphical User Interface VB - Visual.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
1 Study the motion of an object with ticker timer 2 Calculate speed velocity acceleration and deceleration based on ticker timer 3 Solve problems on linear.
Integrated Development Environment Visual Basic IDE Slide 2 of 10 Topic & Structure of the lesson Introduction Integrated Development Environment Tool.
Mark Dixon, SoCCE SOFT 131Page 1 16 – Visual BASIC 6.0.
VB Objects & Events (Exercises) School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Friday 1/31/2003)
Events with Data Arguments Data Values Travel with e.
Slide 1 VB Graphics Controls & Timer Control. Slide 2 Default Controls.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Compunet Corporation Programming with Visual Basic.NET Working with Menus and Dialog Boxes Week 14 Tariq Aziz and Kevin Jones.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
 You won’t write a single line of program code.  Instead, you’ll use visual programming techniques.  Visual Studio processes your actions (such as mouse.
Programming with Microsoft Visual Basic 2012 Chapter 1: An Introduction to Visual Basic 2012.
App Inventor Chapter 17 – Creating Animated Apps.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Creating a movie clip.
Workshop 3.1 Sketching DesignModeler.
3.01 Apply Controls Associated With Visual Studio Form
3.01 Apply Controls Associated With Visual Studio Form
Computer Programming I
Chapter 1: An Introduction to Visual Basic 2015
Simple Windows Applications
Items, Group Boxes, Check Boxes & Radio Buttons
Visual C# - GUI and controls - 1
Chapter 12 Graphics in Windows and the Web
Presentation transcript:

Lecture Roger Sutton CO331 Visual Programming 16: Timer Control 1

CO331 Visual Programming Introduction The timer is an example of a component, as opposed to a control. When it is dragged from the Toolbox to a form, the IDE opens up a Component Tray window to hold the time icon. It is not visible when the program executes. 2 A timer enables methods to be executed periodically and facilitates animation.

CO331 Visual Programming Timer Class A timer creates ‘ticks’ at regular intervals. Each tick is an event which calls the Tick method. The Interval property is set to an integer value representing the time between ticks in milliseconds. Thus if set to 1000, ticks occur every second. Care should be taken when deciding on the Interval setting as too short a time will inhibit interaction. A timer is started and stopped using the Start and Stop methods. These set the Enabled property to True or False programmatically. Several timers may used in a program, each with a different interval. 3 Default interval 100 milliseconds

CO331 Visual Programming Animation To create movement requires a picture to be displayed and then re-displayed repeatedly with slight modifications each time. Example: Consider the task of displaying a ball moving from side to side within box. Two factors need to be considered: How great should be the modification? What time interval should there be between successive pictures? Together these factors govern the speed of movement and the smoothness of continuity. 4 Run

CO331 Visual Programming Animation – cont’d Suppose the ball moves 5 pixels at a time, and The picture is redisplayed every 50 milliseconds (can be modified later if necessary) Let the box be 300 pixels wide and 150 deep. Suppose the ball is 20 pixels in diameter and located by the position of its centre. Accordingly it will start at location (10,75), 10 pixels across and 75 down, and reach the right-hand side at (290,75). At this point the ball will change direction. Essentially the vertical position remains fixed and the horizontal movement changes according to the direction of movement. The next stage is to construct an algorithm. 5

CO331 Visual Programming Example – cont’d Algorithm: 1.Set direction to right Each tick 2.Display box 3.Display ball 4.Move ball 5 pixels in direction of movement 5.If x-location of ball greater than 290 set direction to left 6.If x-location of ball less than 10 set direction to right 6 Form Design: cmdStart Ticker cmdExit picbox1

CO331 Visual Programming Example – cont’d Implementation: 7

CO331 Visual Programming Example – cont’d Implementation – cont’d: 8

CO331 Visual Programming Other examples 1.Circular movement 9 Run

CO331 Visual Programming Other examples – cont’d 2. Wave/Bounce 10 Run

CO331 Visual Programming Other examples – cont’d Wave/bounce ? 11

CO331 Visual Programming Other examples – cont’d 3.Spiral 12 Run

CO331 Visual Programming Other examples – cont’d 4. Rose 13 Run

CO331 Visual Programming Other examples – cont’d 14