# Setting Zoom Factor in Code

You can get or set the form’s ZoomFactor by using the C1Zoom.ZoomFactor property. The following code sets the ZoomFactor to 200% when the button is clicked.

## Content

You can get or set the form’s ZoomFactor by using the **C1Zoom.ZoomFactor** property. The following code sets the ZoomFactor to 200% when the button is clicked.

[C#]

```csharp
private void button1_Click(object sender, EventArgs e)
{
  c1Zoom1.ZoomFactor = 2.0f;
}
```

[Visual Basic]

```vbnet
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
  C1Zoom1.ZoomFactor = 2.0F
End Sub
```


The following image illustrates the **ZoomFactor** set to **200%** when the button is clicked.

![Set the zoom factor to 200%](https://cdn.mescius.io/document-site-files/images/b72f799f-5669-44a4-8119-5f3343d59999/images/zoomfactorex.png)

The following image illustrates the ZoomFactor set to **100%** when the button is clicked.

![Set the zoom factor to 100%](https://cdn.mescius.io/document-site-files/images/b72f799f-5669-44a4-8119-5f3343d59999/images/zoomgfactor100.png)