# Selecting the Chart Control in Spread

Learn how you can select the Chart control at design time in the Spread Designer or at run time. Learn more in documentation.

## Content

You can select the Chart control at design time in the Spread Designer or at run time.
At design time or run time you can select the chart by clicking on it with the mouse.
At run time the user cannot move or resize the chart if the [CanSelect](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Chart.SpreadChart.CanSelect.html) property has been set to false. The [ActiveChart](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.ActiveChart.html) property can be used to programmatically select a chart.
You can specify the order in which the charts are displayed with the [ZIndex](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Chart.SpreadChart.ZIndex.html) property.
The default selected border is a red, solid border with a width of one pixel. You can change this by setting the [SelectedCssClass](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Chart.SpreadChart.SelectedCssClass.html) property.

## Using Code

Set the [CanSelect](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Chart.SpreadChart.CanSelect.html) property in the [SpeadChart](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Chart.SpreadChart.html) class.

## Example

The following example sets the [CanSelect](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Chart.SpreadChart.CanSelect.html) property.

```csharp
FarPoint.Web.Spread.Chart.SpreadChart chart = new FarPoint.Web.Spread.Chart.SpreadChart;
chart.Model = model;
chart.CanSelect = true;
fpSpread1.Sheets[0].Charts.Add(chart);
```

```vbnet
Dim chart As New FarPoint.Web.Spread.Chart.SpreadChart()
chart.Model = model
chart.CanSelect = True
FpSpread1.Sheets(0).Charts.Add(chart)
```