# Adding Alarm Zones

## Content



AlarmZones can be added at design time through the **AlarmZonesCollection Editor** in the Visual Studio Properties window or programmatically through the AlarmZones object.

### To programmatically add an AlarmZone member to the AlarmZonesCollection:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
C1Chart1.ChartArea.PlotArea.AlarmZones.AddNewZone()
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
c1Chart1.ChartArea.PlotArea.AlarmZones.AddNewZone();
```

DOC-DETAILS-TAG-CLOSE

### To access the collection editor at design time:

1.  Right-click on the **C1Chart2D** control and select Properties from its context menu.
2.  In the Properties Window, expand the ChartArea node in the Properties window, then expand the PlotArea node, and click the **ellipsis** next to the **AlarmZones** property.

For more information on the **AlarmZone Collection Editor**, see [AlarmZone Collection Editor](/componentone/docs/win/online-chart2d/designtimesupport/c1chartcollectionedi/alarmzonecollectione).

## See Also

[Defining Alarm Zones Properties](/componentone/docs/win/online-chart2d/chartareaandplotarea/plotarea/alarmzones/definingalarmzonespr)