Scroll Bars, CheckBoxes, Control Arrays, Timers and U N I letters
striking a pose
Due date: Monday, September 24th, 2001 (by 10 p.m.)
Click to see 1st half of Visual Basic code
window for the above application.
Note: The chkSize_Click() event is NOT included.
You must invent
that code. It will be similar to the chkColor_Click()
and chkAlignment_Click() events.
Here is the 2nd half of the VB code, including
the Timer1_Timer event and the two vsbSpeed vertical scroll bar events.
The Object Browser window
is invoked by using Visual Basic
View menu, Object Browser
command. It enables us to discover the intrinsic constant values for
the
CheckBox control. They are vbChecked, vbUnchecked and vbGrayed.
The vsbSpeed Scroll Bar control (vertical scroll bar) would have
the following properies set:
Min: 50, which would mean the speed of the animation would
be 50 milliseconds, or 20 changes per second.
Max: 2000, which would set the slowest dance to one move every
2000 milliseconds, or 2 seconds.
LargeChange: 200, which means the vsbSpeed would change from
500 to either 300 or 700 depending on the direction
of the LargeChange Change event.
SmallChange: 50, which would cause a change from 500 to 450 when
clicking on the up arrow or a change
from 500 to 550 when clicking on the down arrow.
Value: Whatever value you want the vsbSpeed to be started at.
200 or 500 would be good.
A Control Array is an array of more
than one control. In this program, the lblWord(0), lblWord(1) and
lblWord(2)
objects are an ARRAY of 3 label controls. They all have the SAME NAME
property, lblWord, but different INDEX property values (0, or 1, or 2).
The Timer1 object should be set to FALSE at DESIGN TIME to its
Enabled property. If it is set the ENABLED = TRUE at DESIGN time,
then the original caption saying
"Start UNI Animation" would not make sense. The animation would
already be running, and all the user would have to do would be
click on any checkbox, such as chkColor or chkSize or chkAlignment to
see stuff happening.
Due date: Monday September 24th, 2001
The Dancing U N I program should be turned in with at
least 4 different screen snapshots (Alt + PrintScreen) showing that
different features of the program work okay.
For example, I should see TWO of the THREE
different Caption properties for the cmdAnimate button in your screen
snapshots, and see different vertical scroll bar settings with vsbSpeed
and its associated label lblSpeed.
You MAY add extra features to the Dancing U N I program, if you
wish.
I would recommend adding the
lbWord(Letter).BackColor = RGB(255 - r, 255 - g, 255 - b)
statement to your program in the Timer1_Timer() event. This
will be discussed in class. I will demonstrate this added feature
during class.
You might also wish to add a feature that switches the UNI to USA,
and another that switches it back from U S A to U N I . This will be
demonstrated in class as well.