# C1.Win.TouchToolKit.C1Zoom.BeginAddControls

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_TouchToolKit_C1Zoom_BeginAddControls_" data-uid="C1.Win.TouchToolKit.C1Zoom.BeginAddControls*">BeginAddControls Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_TouchToolKit_C1Zoom_BeginAddControls_" data-uid="C1.Win.TouchToolKit.C1Zoom.BeginAddControls*"></a>
<h4 id="C1_Win_TouchToolKit_C1Zoom_BeginAddControls" data-uid="C1.Win.TouchToolKit.C1Zoom.BeginAddControls">BeginAddControls()</h4>
<div class="markdown level1 summary"><p>Call this method before change child control collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void BeginAddControls()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub BeginAddControls()</code></pre>
</div>
<h5 id="C1_Win_TouchToolKit_C1Zoom_BeginAddControls_examples">Examples</h5>
<p>
  The following code example shows how to use this method.
</p>
<p>
  This code example is part of a larger example provided for the <a class="xref" href="C1.Win.TouchToolKit.C1Zoom.Controls.html#C1_Win_TouchToolKit_C1Zoom_Controls">Controls</a> property.
</p>
<pre><code class="lang-csharp">public class GcZoomControlsDemo : Form
{
	private GcZoom _gcZoom1 = new GcZoom();
	private Button _changeChildControlButton;

	public GcZoomControlsDemo()
	{
		InitializeComponent();

		_gcZoom1.Target = this;

		_changeChildControlButton.Click += _changeChildControlButton_Click;
	}

	void _changeChildControlButton_Click(object sender, EventArgs e)
	{
		Button newButton = new Button();
		newButton.Text = "New Button";
		newButton.Location = new Point(100, 100);
		newButton.Size = new Size(this.Size.Width / 2, this.Size.Height / 2);

		_gcZoom1.BeginAddControls();
		_gcZoom1.Controls.Add(newButton);
		_gcZoom1.EndAddControls();
	}

	private void InitializeComponent()
	{
		_changeChildControlButton = new Button();
		_changeChildControlButton.Text = "ChangeChildControl";
		_changeChildControlButton.Location = new Point(20, 190);
		_changeChildControlButton.Size = new Size(120, 25);
		this.Controls.Add(_changeChildControlButton);
	}
}</code></pre>
<pre><code class="lang-csharp">Public Class GcZoomControlsDemo
	Inherits Form
	Private _gcZoom1 As New GcZoom()
	Private _changeChildControlButton As Button

	Public Sub New()
		InitializeComponent()

		_gcZoom1.Target = Me

		AddHandler _changeChildControlButton.Click, AddressOf _changeChildControlButton_Click
	End Sub

	Private Sub _changeChildControlButton_Click(sender As Object, e As EventArgs)
		Dim newButton As New Button()
		newButton.Text = "New Button"
		newButton.Location = New Point(100, 100)
		newButton.Size = New Size(Me.Size.Width \ 2, Me.Size.Height \ 2)

		_gcZoom1.BeginAddControls()
		_gcZoom1.Controls.Add(newButton)
		_gcZoom1.EndAddControls()
	End Sub

	Private Sub InitializeComponent()
		_changeChildControlButton = New Button()
		_changeChildControlButton.Text = "ChangeChildControl"
		_changeChildControlButton.Location = New Point(20, 190)
		_changeChildControlButton.Size = New Size(120, 25)
		Me.Controls.Add(_changeChildControlButton)
	End Sub
End Class</code></pre>

</div>
