ComponentOne Gauges for WinForms
Step 2 of 3: Customizing C1Gauge
Gauges for WinForms Quick Start > Step 2 of 3: Customizing C1Gauge

In the last step you created new application and added a C1Gauge control to the form. In this step you'll customize the gauge by using the Gauges for WinForms designers.

To customize the C1Gauge control, complete the following steps:

  1. Double-click the C1Gauge1 control on the form. The Item Editor appears.
  2. Set the Maximum property to 120. The gauge scale will now run from 0 to 120.

Adding Tick Marks

  1. Click the ellipsis button next to the Decorators property. The Decorators Collection Editor appears.
  2. Click the drop-down list on the Add button and select C1GaugeMarks.
  3. Expand the Filling node and set the Color property to DarkGray.
  4. Set the Interval property to 10. This will create tick marks at every 10th interval. Next we will add minor tick marks.
  5. Click the drop-down list on the Add button again and select C1GaugeMarks.
  6. Set the Interval property to 2.5.
  7. Expand the Filling node and set the Color property to DarkGray.
  8. Set the Length property to 5. Next we will add tick labels.

Adding Tick Labels

  1. Click the drop-down list on the Add button and select C1GaugeLabels.
  2. Set the Color property to Black.
  3. Set the Interval property to 10. This will create tick labels at every 10th interval.
  4. Set the From property to 20. This will add the labels on value 20 and higher.
  5. Click OK to close the Decorators Collection Editor.

Customize the Pointer, Cap, and Caption

  1. In the Item Editor, expand the Filling node within the Pointer node, and set the Color property to Black.
  2. Expand the Filling node within the Cap node, and set the Color property to DarkGray.
  3. Click the ellipsis button next to FaceShapes. The FaceShapes Collection Editor opens.
  4. Click the Add drop-down arrow and select C1GaugeCaption.
  5. Enter C1Gauge next to the Text property.
  6. Set the Color property to Red.
  7. Enter .9 next to the CenterPointY property. This will move the text down the gauge.
  8. Click OK to close the FaceShapes Collection Editor and click OK again to close the Item Editor.

What You've Accomplished

You've customized the appearance of the C1Gauge control. Next you will run the application.

See Also