# C1.Win.TouchToolKit.C1Zoom.Controls

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_TouchToolKit_C1Zoom_Controls_" data-uid="C1.Win.TouchToolKit.C1Zoom.Controls*">Controls Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_TouchToolKit_C1Zoom_Controls_" data-uid="C1.Win.TouchToolKit.C1Zoom.Controls*"></a>
<h4 id="C1_Win_TouchToolKit_C1Zoom_Controls" data-uid="C1.Win.TouchToolKit.C1Zoom.Controls">Controls</h4>
<div class="markdown level1 summary"><p>Gets the child controls of the owner form.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[Browsable(false)]
public Control.ControlCollection Controls { get; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">&lt;Browsable(False)&gt;
Public ReadOnly Property Controls As Control.ControlCollection</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.control">Control</a>.<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.control.controlcollection">ControlCollection</a></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.control">Control.ControlCollection</a> value that represents the child controls of the owner form.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_TouchToolKit_C1Zoom_Controls_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>After form loaded, <a class="xref" href="C1.Win.TouchToolKit.C1Zoom.html">C1Zoom</a> will change all child controls from form to a inner panel.
So, if a form attached to a <a class="xref" href="C1.Win.TouchToolKit.C1Zoom.html">C1Zoom</a>, user should use <a class="xref" href="C1.Win.TouchToolKit.C1Zoom.Controls.html#C1_Win_TouchToolKit_C1Zoom_Controls">GcZoom.Controls</a> property instead of <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.control.controls">Form.Controls</a> property.</p>
</div>
<h5 id="C1_Win_TouchToolKit_C1Zoom_Controls_examples">Examples</h5>
<p>
  The following code example shows how to use this method.
</p>
<pre><code class="lang-csharp">public class GcZoomControlsDemo : Form
{
	private GcZoom _gcZoom1 = new GcZoom();
	private Button _controlsButton;
	private Button _changeChildControlButton;

	public GcZoomControlsDemo()
	{
		InitializeComponent();

		_gcZoom1.Target = this;

		_controlsButton.Click += _controlsButton_Click;
		_changeChildControlButton.Click += _changeChildControlButton_Click;
	}

	void _controlsButton_Click(object sender, EventArgs e)
	{
		foreach (Control item in _gcZoom1.Controls)
		{
			Console.WriteLine(item.ToString());
		}
	}

	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()
 	{
		_controlsButton = new Button();
		_controlsButton.Text = "Controls";
		_controlsButton.Location = new Point(20, 130);
		_controlsButton.Size = new Size(120, 25);

		_changeChildControlButton = new Button();
		_changeChildControlButton.Text = "ChangeChildControl";
		_changeChildControlButton.Location = new Point(20, 190);
		_changeChildControlButton.Size = new Size(120, 25);

		this.Controls.Add(_controlsButton);
		this.Controls.Add(_changeChildControlButton);
 	}
}</code></pre>
<pre><code class="lang-csharp">Public Class GcZoomControlsDemo
	Inherits Form
	Private _gcZoom1 As New GcZoom()
	Private _controlsButton As Button
	Private _changeChildControlButton As Button

	Public Sub New()
		InitializeComponent()

		_gcZoom1.Target = Me

		AddHandler _controlsButton.Click, AddressOf _controlsButton_Click
		AddHandler _changeChildControlButton.Click, AddressOf _changeChildControlButton_Click
	End Sub

 	Private Sub _controlsButton_Click(sender As Object, e As EventArgs)
	 	For Each item As Control In _gcZoom1.Controls
		 	Console.WriteLine(item.ToString())
	 	Next
 	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()
		_controlsButton = New Button()
	 	_controlsButton.Text = "Controls"
		_controlsButton.Location = New Point(20, 130)
		_controlsButton.Size = New Size(120, 25)

	 	_changeChildControlButton = New Button()
	 	_changeChildControlButton.Text = "ChangeChildControl"
	 	_changeChildControlButton.Location = New Point(20, 190)
	 	_changeChildControlButton.Size = New Size(120, 25)

	 	Me.Controls.Add(_controlsButton)
	 	Me.Controls.Add(_changeChildControlButton)
	End Sub
End Class</code></pre>

</div>
