> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# CanvasZoomState

## Definition

Indicates the current state of the Zoom tool on the chart. This property reveals the state of the tool while it is in use, and does not indicate a chart is zoomed in on or not. As soon as a zoom action is completed, the tool is considered to be no longer in use.

## Property Value

An enum representing the state of the Zoom tool on the chart. Possible values are listed below:

| State            | Description                                                                                  |
| ---------------- | -------------------------------------------------------------------------------------------- |
| None             | The Zoom tool is not currently being used                                                    |
| Selected         | The Zoom tool is selected, but has not yet been used to zoom in                              |
| DrawingRectangle | The Zoom tool is currently in use (User is currently drawing the rectangle in which to zoom) |

## Syntax

`\<chartcontrol\>.CanvasZoomState`

## Examples

```csharp
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
    CanvasZoomState zoomState = chartControl.CanvasZoomState;

    // Trigger an alert while a user is zooming in on a chart
    if (zoomState == CanvasZoomState.DrawingRectangle)
        Alert("zoomAlert", Priority.Medium, "Make sure to zoom in on the entire chart pattern!", " ", 60, Brushes.White, Brushes.Black);
}
```

Based on the image below, CanvasZoomState confirms that the Zoom rectangle is currently being drawn:

![ChartControl\_CanvasZoomState](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/ninjatrader-public.docs.buildwithfern.com/01062806c3ed970bbc6819a9670087b050d58d631fc00c269af6e32ffd93301d/docs/assets/developer/desktop-sdk/references/canvaszoomstate-chartcontrol-canvaszoomstate.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260729%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260729T062352Z&X-Amz-Expires=604800&X-Amz-Signature=19113444d59b28386c66a134abdf1c853ba62f98c2e65f9f06acab9722efcd77&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)