Testing the Control CircleOffset Property

You implemented CircleOffset functionality, and you can use Test Container to test it.

To insert the Circ control in Test Container

  1. On the Tools menu, click ActiveX Control Test Container.

  2. On the Edit menu, click Insert New Control.

    The Insert Control dialog box appears.

  3. From the list box, select Circ Control.

  4. Click OK to close the Insert Control dialog box and insert the control into Test Container.

The Circle control is displayed in Test Container. Notice that the control is initially drawn as a perfect circle. The default bounding rectangle of the control is a rectangle with an x-extent greater than its y-extent.

Next, change the value of the CircleOffset property to cause the circle to move from the center of the bounding rectangle:

To change the CircleOffset property

  1. On the Control menu, click Invoke Methods.

    The Invoke Methods dialog box appears.

  2. From the Method Name drop-down combo box, select the PropPut version of CircleOffset.

    The Value column in the Parameters control displays 0 (zero), which is the CircleOffset property's default value.

    In the Parameter Value control, type 10, which indicates 10 units to the right of center. (If the y-extent of the control were larger, it would indicate 10 units to the top of center.)

  3. Click Set Value and then Invoke.

    The Circle control is redrawn, with the circle offset from center by 10 units.

Experiment with different values for the CircleOffset property: type a negative number to force the circle to the left of center. Try a number larger than the width or height of the control; for example, 2000. Notice that nothing happens.

Now, resize the control so that its y-extent is greater than its x-extent. Specify positive and negative values for the CircleOffset property to see how the circle moves above and below the center of the control's bounding rectangle.

When you have finished, close Test Container.