You are on page 1of 2

THE TIMER CONTROL

A Timer is a powerful clock and once started, a timer works independently and constantly No
matter w!at else mi"!t !appen in t!e #isual $asic pro"ram, t!e timer keeps tickin"
A Timer control can e%ecute code at re"ular inter&als 'y causin" a Timer e&ent to occur T!e
Timer e&ent is t!e only e&ent of t!e Timer control Inter&al is important in order to tri""er Timer
e&ent and do some actions T!e Inter&al property of a timer is a duration T!e Inter&al determines
!ow lon" t!e Timer must wait 'efore carryin" out any instructions
T!e Timer control is a sop!isticated #isual $asic control and is far different from ot!er controls
like command control Command()click*+ is tri""ered t!e &ery moment t!e user clicks t!e 'utton
,it! Timer control, w!en its e&ent is tri""ered, it t!en looks at its Inter&al property and wait until
t!at inter&al of time !as passed 'efore it carries out any instructions t!e pro"rammer placed into
its E&ent
T!e Timer control, in&isi'le to t!e user *it is not seen in t!e run mode+, is useful for 'ack"round
processin"
-ou can.t set t!e Ena'led property of a Timer for a multiple selection of controls ot!er t!an Timer
controls /ettin" t!e Ena'led property of a Timer to True, tri""ers its e&ent and do some actions
Timer can 'e stopped from e%ecutin" statements 'y settin" its Ena'led property into 0alse
T!ere is no practical limit on t!e num'er of acti&e timer controls you can !a&e in #isual $asic
runnin" under ,indows 12 or ,indows NT
Manipulatin" Timer Control
3 /et timer.s inter&al to 4 seconds
Timer(inter&al54666
*( second5 (666 milliseconds+
3 Turn7on t!e timer control
Timer(ena'led5True
3 /top t!e timer control from e%ecutin" statements
Timer(ena'led50alse
8 THE /HA9E CONTROL
T!e /!ape control allows you to create desi"ns more easily t!an usin" t!e Line and Circle
commands
6 7 Rectan"le
( 7 /:uare
4 7 O&al
; 7 Circle
< 7 Rounded Rectan"le
2 7 Rounded /:uare
T!ese s!apes can 'e selected in t!e /!ape property of /!ape control
=ses Of /!ape Control
3 Creates attracti&e frames around &arious o'>ects in t!e 0orms
3 C!an"es t!e appearance of Command $uttons and t!e like, dependin" on w!et!er or not t!ey
are currently appropriate to t!e user.s task at !and
3 Hi"!li"!t parts of ima"es or te%t
3 /eparate ?ones of a 0orm into lo"ical areas, reflectin" t!e purposes of t!e different parts of t!e
0orm
A /!ape Control !as no e&ents
/!ape Control 9roperties
( $ackColor 1 Hei"!t
4 $ack/tyle (6 Inde%
; $orderColor (( Left
< $order/tyle (4 Name
2 $order,idt! (; /!ape
@ ArawMode (< Top
B 0illColor (2 ,idt!
C 0ill/tyle (@ #isi'le
8 /CROLL $AR/
T!ere are two types of /croll $ars, namelyD t!e Hori?ontal and t!e #ertical /croll $ars T!ese
/croll $ars !a&e correspondin" controls in t!e tool'o% T!ey are usually descri'ed as &alue or
arrow controls
A /croll $ar is an analo" control It acts like t!e &olume kno' on a stereo T!e position of an
analo" control is an analo"y, a sym'ol t!at s!ows t!e status of t!e t!in" it ad>usts
/croll $ars !a&e fi&e uni:ue propertiesD
#alue T!e #alue property tells t!e current numerical e:ui&alent of t!e position of t!e mo&a'le
s:uares *sometimes called t!e ET!um'F or E/croll $o%F+ wit!in a /croll $ar
Ma% and Min T!ey determine t!e ran"e of num'ers possi'le for t!e #alue property $y default,
Min is 6 and Ma% is ;4,B@C Ma% and Min.s &alues can 'e ad>usted to refelect t!e ran"e of
w!ate&er t!e 'ar is supposed to control
Lar"eC!an"e and /mallC!an"e T!ese properties play an important role in t!e mo&ement of t!e
/croll $ar Clickin" on t!e arrows at eit!er end of t!e 'ar mo&es a small anount w!i! is defined
'y /mallC!an"e Clickin" wit!in a 'ar mo&es a lar"e amount w!ic! is defined 'y Lar"eC!an"e
T!e default &alue of t!ese properties is (, 'ut it can 'e ad>usted to a lar"er &alue particularly
Lar"eC!an"e

You might also like