Slide 1 VB Graphics Controls & Timer Control. Slide 2 Default Controls.

Slides:



Advertisements
Similar presentations
Chapter 9 Color, Sound and Graphics
Advertisements

Programming with Microsoft Visual Basic th Edition
Chapter 1: An Introduction to Visual Basic 2012
© by Pearson Education, Inc. All Rights Reserved. continued …
Compunet Corporation Programming with Visual Studio.NET GUI Week 13 Tariq Aziz and Kevin Jones.
Flowchart Start Input weight and height
VB Default Controls List Box, Combo Box
 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 31 - Dynamic HTML: Path, Sequencer and Sprite ActiveX Controls Outline 31.1Introduction 31.2DirectAnimation.
VB Controls and Events Week 7: Picture Box, Image Box, Option, Check box, Mouse over, Frames, Shapes.
JavaScript, Third Edition
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.
Controls General Discussion. VB Controls Visual Basic Controls A control is the generic name for any object placed on a form Controls may be images,
Chapter 10: Move! Creating Animation
Multimedia ! Graphics ! Animation ! Sound Tip Of the Day 4 Tip of the Day: When using graphic methods at Form Load, the AutoRedraw property of the container.
IE 411/511: Visual Programming for Industrial Applications
COMPUTER PROGRAMMING I Objective 8.03 Apply Animation and Graphic Methods in a Windows Form (4%)
How to create a Splash Screen in MS Access Carlos Coronel.
BIM211 – Visual Programming Objects, Collections, and Events 1.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
EET 2259 Unit 7 Case Structures; Sequence Structures  Read Bishop, Sections 5.4 and 5.5.  Lab #7 and Homework #7 due next week.  Quiz #3 next week.
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.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Element 5 Adding Images Images. LEARNING OUTCOMES 1. Insert images and/or graphics into a word processing document and customize according to requirements.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
Chapter 4 Operation / Guide Screen Otasuke GP-EX! Chapter 4 Operation/Guide Screen.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
Arrays Code: Arrays Controls: Control Arrays, PictureBox, Timer.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
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.
Visual Basic.NET BASICS Lesson 3 Events and Code.
Chapter 5: Windows and Frames
CC111 Lec7 : Visual Basic 1 Visual Basic(1) Lecture 7.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Chapter 2 – Introduction to the Visual Studio .NET IDE
COMPUTER PROGRAMMING I SUMMER 2011 Objective 8.02 Apply Procedures to Create Picture Boxes using Images. (5%)
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.
Forms and Controls Part 3 dbg --- Naming conventions, Button, Event handlers, Label.
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.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
CBA Unit 5 Presentations Definitions. Animation adding sound or special effects to the way text and objects move on and off a slide during a slide show.
Forms and Controls Part 3 dbg --- Naming conventions, Button, Event handlers, Label.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Chapter 2 Creating Applications with 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.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 10: Move! Creating Animation 1 Android.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
 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.
Animations & Multimedia LESSON 9 #2.09 USING ANIMATION AND MULTIMEDIA.
Chapter 1: An Introduction to Visual Basic .NET
PictureBox, MessageBox, Multiple Forms, Splash Screens and Timers
Introduction to Computer CC111
Chapter 2 – Introduction to the Visual Studio .NET IDE
Objective 8.02 Apply Procedures to Create Picture Boxes using Images.
Chapter 1: An Introduction to Visual Basic 2015
Visual studio 2010 SENG 403, Tutorial 2 SENG Winter 2011.
VB 6.0.
Save this template as a presentation (.ppt file) on your computer.
More on Graphical User Interfaces
Chapter 6 Sub Procedures
Simple Windows Applications
2.02C Frame-by-Frame Computer Animation Using PowerPoint
Save this template as a presentation (.ppt file) on your computer.
CIS 16 Application Development Programming with Visual Basic
P.J.Balakumaran, AP, Commerce CA, SNMV CAS
Presentation transcript:

Slide 1 VB Graphics Controls & Timer Control

Slide 2 Default Controls

Slide 3 Graphics File Formats used with VB

Slide 4 Using Images v At design time: Select a image thru the Picture property (form, Picture box or Image Box) v At Runtime: Form1.Picture = LoadPicture(“C:\MYPIC.BMP”) Image1.Picture = LoadPicture(“D:\PAMELA.JPG”) Picture1.Picture = image1.Picture Picture1.Picture = LoadPicture(“”) v Passing an empty string to the LoadPicture function clears the current picture.

Slide 5 Using Images with Forms v At design time: Select a form background image thru the Picture property v At Runtime: Form1.Picture = LoadPicture(“C:\MYPIC.BMP”) v picture that is placed directly on a form. If you want the picture to be a different size, you need to resize the original graphic file using a graphics utility.

Slide 6 Using Images with Forms v Placing the picture directly on the form have several drawbacks: –You cannot hide the picture; it can only be loaded or unloaded. –You cannot control the placement of the picture on the form. –You can place only one picture at a time on the form. –You cannot resize the picture. It’s placed on the form in its original (saved) size. v You can overcome these drawbacks by using the Picture or Image control.

Slide 7 Image Control v Provides a frame for the picture, allowing you to position it anywhere on the form. v Pictures can be resized. v Stretch property: –False (the default): the Image control is automatically resized to fit the picture you assign to it. –True: the picture is automatically resized so that the entire picture fits within the current boundaries of the Image control.

Slide 8 PictureBox Control v Although the PictureBox control uses more system resources than the Image control, it has some added features: –Can be used as a container for other controls –Drawing methods (for example, Line and Print) can be used to draw on the picture box v PictureBox does not allow resizing of the picture v Setting AutoSize property to True cause the PictureBox control to resize itself to fit the current picture.

Slide 9 The Timer Control v Executes code (in its Timer event) when the interval is complete. v Counts down repeatedly, as long as the Enabled property is set to True. v Designed to work with very small amounts of time; the maximum setting is just a little longer than a minute. v Uses: scheduling and performing repeated operations.

Slide 10 Setting Up the Timer v First draw it on the form, it does not show up at all while your program is running. v Place code in the Timer event and then set the following properties, either at designtime or runtime: –Set the Interval property. –Set the Enabled property to True. The Interval property can be set to any value between zero and 65,535.

Slide 11 The Timer Control v The Enabled property acts like a switch that turns your timer on and off. If the Timer control is enabled, the code in the Timer event is executed at the end of the time specified in the Interval property. v The Interval property can be set to any value between zero (disables the Timer control) and 65,535 milliseconds. v 10 seconds = 10,000 milliseconds.

Slide 12 Creating a Simple Animation Following is an example of using the timer control for a simple animation. Set the Interval property to 200 and the Enabled property to True.