|
Passing Digital Values to a Component
 |
- Place an instance of the Symbol Factory Standard Control on your form and pick an image you would like to animate
- Right click on the control and bring up the Symbol Factory Standard Control property sheet
- Select the Animation tab
- Select "DiscreteColorFill" in the AnimationMode property.
- Select the number of bands of animation you wish to have (1 to 15) (see Using Bands for details)
- Set the Style of Animation and Color for each band (see Using Bands for details)
- Set the Breakpoints for when you want the animation to change (see Using Bands for details)
- Click on the Apply button
- Pass the value that you want to control the animation to the control using the following syntax:
|
C#
standardControl1.BandsCollection[1].DiscreteValue = false;
or
bool discreteValue = false; standardControl1.BandsCollection[1].DiscreteValue = discreteValue;
|
|
VB
standardControl1.BandsCollection[1].DiscreteValue = false;
or
Dim discreteValue As Bool discreteValue = false standardControl1.BandsCollection(1).DiscreteValue = discreteValue;
|
Accessing Individual Elements within the Band Collection
Each band in the BandsCollection is Zero-based addressed. That is, the first element in the collection is accessed with an
index number of 0, the second element with 1, the third element with 2, and so on.
The key here then is to make sure that you are accessing the correct element. The easiest way to determine this is to bring up the BandsCollection editor from the Properties window:

Next, take a look at the bands you have already created. The number to the left of each instance is the number you need to use as the index number for the BandsCollection.

So if you were to access the band that has the caption "HiHi" (as above), the index will be 0, and the code you will use is as follows:
|
VB
standardControl1.BandsCollection(0).DiscreteValue = false;
|
|
C#
standardControl1.BandsCollection[0].DiscreteValue = false;
|
Previous: Passing Analog Values to a Component Next: Building Tank Cutaway Graphics
|