# Adding Controls at Run Time

To add some controls  to the C1ZoomPanel at runtime, use C1ZoomPanel.BeginAddControls and C1ZoomPanel.EndAddControls methods. You also have to use the InnerControls property of C1ZoomPanel class. instead of the Controls property.

## Content



To add some controls to the **C1ZoomPanel** at runtime, use <span data-popup-content="" data-popup-title="C1ZoomPanel.BeginAddControls" data-popup-theme="ui-tooltip-green qtip-green">C1ZoomPanel.BeginAddControls</span> and **C1ZoomPanel.EndAddControls** methods. You also have to use the **InnerControls** property of <span data-popup-content="This class is available in \u003ca href=\u0022/componentone/docs/win/online-touchtoolkit/\u0022\u003e.NET\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-touchtoolkit/\u0022\u003e.NET Framework\u003c/a\u003e." data-popup-title="C1ZoomPanel" data-popup-theme="ui-tooltip-green qtip-green">C1ZoomPanel</span> class. instead of the **Controls** property.

1.  Add C1ZoomPanel to the Form. (C1ZoomPanel1)
2.  Add a Button control to the C1ZoomPanel. (Button1)
3.  Use the following code for Button1.Click event.

```csharp
private void button1_Click(object sender, EventArgs e)
{
    c1ZoomPanel1.BeginAddControls();
    Button button2 = new Button();
    c1ZoomPanel1.InnerControls.Add(button2);
    button2.Text = "Button2";
    button2.Visible = true;
    button2.Left = button1.Left;
    button2.Top = button1.Top + button1.Height + 10;
    c1ZoomPanel1.EndAddControls();
}
```

```vbnet
Private Sub Button1_Click(sender As System.Object, e As System.E.ventArgs) Handles Button1.Click
    C1ZoomPanel1.BeginAddControls()
    Dim button2 As New Button()
    C1ZoomPanel1.InnerControls.Add(button2)
    button2.Text = "Button2"
    button2.Visible = True
    button2.Left = Button1.Left
    button2.Top = Button1.Top + Button1.Height + 10
    C1ZoomPanel1.EndAddControls()
End Sub
```

4.Run the project, Zoom-up C1ZoomPanel content and then click Button1.

5.Confirm Button2 is added in the expected position and size.