0% found this document useful (0 votes)
31 views1 page

Lesson 6

1. The document discusses the Timer control in Visual Basic, which triggers an event at regular intervals specified by its Interval property. 2. The Timer control works in the background and has properties like Enabled, Index, and Interval. It fires its single Timer event every number of milliseconds equal to the Interval value. 3. An example uses the Timer to toggle the Visible property of two images, creating a simple animation that is shown when the program is run.

Uploaded by

api-287763322
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views1 page

Lesson 6

1. The document discusses the Timer control in Visual Basic, which triggers an event at regular intervals specified by its Interval property. 2. The Timer control works in the background and has properties like Enabled, Index, and Interval. It fires its single Timer event every number of milliseconds equal to the Interval value. 3. An example uses the Timer to toggle the Visible property of two images, creating a simple animation that is shown when the program is run.

Uploaded by

api-287763322
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Lesson 6

Timer
Timer Properties

OBJECTIVES:
1. Value the importance of Timer in Visual Basic.
2. Explore timer through Example.
3. Develop your knowledge and skills using timer.
Timer
The Timer control works in the background you do not see it on the

Form at runtime. The primary purpose of a Timer is to trigger an event at a


certain interval. The following are the properties of a Timer.

Property

Description

Enabled

Determines whether the Timer can respond to events.

Index

Specifies the subscript of the control in a control array.

Interval

Specifies the number of milliseconds between calls to a Timer


controls Timer event. The value must be within the range of 1 to
65535. This value is in millisecond (or a thousandth of a second).

The Timer has one event, the Time event. The procedure <timer_name>.

Timer( ) is executed every <interval_value> milliseconds.

The Timer control continues this until we disable the control by setting
the Enabled property to False.
In the following example, I use a very simple technique to show animation
by using the properties Visible=False and Visible=true to show and hide two
images alternately. When you click on the program, you should see the following
animation.

You might also like