# C1.Win.TouchToolKit.C1ZoomAttachingEventArgs

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Win_TouchToolKit_C1ZoomAttachingEventArgs" data-uid="C1.Win.TouchToolKit.C1ZoomAttachingEventArgs" class="text-break">C1ZoomAttachingEventArgs Class
</h1>
  <div class="markdown level0 summary"><p>Provides data for <a class="xref" href="C1.Win.TouchToolKit.C1ApplicationZoom.C1ZoomAttaching.html">C1ZoomAttaching</a> event of <a class="xref" href="C1.Win.TouchToolKit.C1ApplicationZoom.html">C1ApplicationZoom</a> class.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.eventargs">EventArgs</a></div>
    <div class="level2"><span class="xref">C1ZoomAttachingEventArgs</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Win.TouchToolKit.html">C1.Win.TouchToolKit</a></h6>
  <h6><strong>Assembly</strong>: C1.Win.TouchToolKit.10.dll</h6>
  <h5 id="C1_Win_TouchToolKit_C1ZoomAttachingEventArgs_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class C1ZoomAttachingEventArgs : EventArgs</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class C1ZoomAttachingEventArgs
    Inherits EventArgs</code></pre>
  </div>
  <h5 id="C1_Win_TouchToolKit_C1ZoomAttachingEventArgs_examples"><strong>Examples</strong></h5>
  <p>
  The following code example shows how to use <a class="xref" href="C1.Win.TouchToolKit.C1ZoomAttachingEventArgs.html">C1ZoomAttachingEventArgs</a> class.
</p>
<p>
  This code example is part of a larger example provided for the <a class="xref" href="C1.Win.TouchToolKit.C1ApplicationZoom.html">C1ApplicationZoom</a> class.
</p>
<pre><code class="lang-csharp">public class GcApplicationZoomDemo : Form
{
	private Button _showForm2Button;
	private GcApplicationZoom _gcApplicationZoom;

	public GcApplicationZoomDemo()
	{
		InitializeComponent();

		_showForm2Button.Click += _showForm2Button_Click;
		_gcApplicationZoom.GcZoomAttaching += _gcApplicationZoom_GcZoomAttaching;
	}

	void _gcApplicationZoom_GcZoomAttaching(object sender, GcZoomAttachingEventArgs e)
	{
		// May be some forms should not be zoom.
		if (e.Form is NormalForm)
		{
			e.Cancel = true;
		}
		else
		{
			e.GcZoom.AutoShowControl = true;
		}
	}

	void _showForm2Button_Click(object sender, EventArgs e)
	{
		Form form = new NormalForm();
		form.Show();
	}

	private void InitializeComponent()
	{
		_gcApplicationZoom = new GcApplicationZoom();

		_showForm2Button = new Button();
		_showForm2Button.Text = "Click to open NormalForm";
		_showForm2Button.Location = new Point(20, 80);
		_showForm2Button.Size = new Size(200, 40);
		this.Controls.Add(_showForm2Button);
	}
}

internal class NormalForm : Form
{
	private Button _showFormButton;

	public NormalForm()
	{
		InitializeComponent();

		_showFormButton.Click += _showFormButton_Click;
	}

	void _showFormButton_Click(object sender, EventArgs e)
	{
		Form form = new NormalForm();
		form.Show();
	}

	private void InitializeComponent()
	{
		_showFormButton = new Button();
		_showFormButton.Text = "Click to open a new form";
		_showFormButton.Location = new Point(20, 20);
		_showFormButton.Size = new Size(200, 40);
		this.Controls.Add(_showFormButton);
		this.Text = "NormalForm";
	}
}</code></pre>
<pre><code class="lang-csharp">Public Class GcApplicationZoomDemo
	Inherits Form
	Private _showForm2Button As Button
	Private _gcApplicationZoom As GcApplicationZoom

	Public Sub New()
		InitializeComponent()

		AddHandler _showForm2Button.Click, AddressOf _showForm2Button_Click
		AddHandler _gcApplicationZoom.GcZoomAttaching, AddressOf _gcApplicationZoom_GcZoomAttaching
	End Sub

	Private Sub _gcApplicationZoom_GcZoomAttaching(sender As Object, e As GcZoomAttachingEventArgs)
		' May be some forms should not be zoom.
		If TypeOf e.Form Is NormalForm Then
			e.Cancel = True
		Else
			e.GcZoom.AutoShowControl = True
		End If
	End Sub

	Private Sub _showForm2Button_Click(sender As Object, e As EventArgs)
		Dim form As Form = New NormalForm()
		form.Show()
	End Sub

	Private Sub InitializeComponent()
		_gcApplicationZoom = New GcApplicationZoom()

		_showForm2Button = New Button()
		_showForm2Button.Text = "Click to open NormalForm"
		_showForm2Button.Location = New Point(20, 80)
		_showForm2Button.Size = New Size(200, 40)
		Me.Controls.Add(_showForm2Button)
	End Sub
End Class

Friend Class NormalForm
	Inherits Form
	Private _showFormButton As Button

	Public Sub New()
		InitializeComponent()

		AddHandler _showFormButton.Click, AddressOf _showFormButton_Click
	End Sub

	Private Sub _showFormButton_Click(sender As Object, e As EventArgs)
		Dim form As Form = New NormalForm()
		form.Show()
	End Sub

	Private Sub InitializeComponent()
		_showFormButton = New Button()
		_showFormButton.Text = "Click to open a new form"
		_showFormButton.Location = New Point(20, 20)
		_showFormButton.Size = New Size(200, 40)
		Me.Controls.Add(_showFormButton)
	End Sub
End Class</code></pre>

  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_TouchToolKit_C1ZoomAttachingEventArgs__ctor_C1_Win_TouchToolKit_C1Zoom_System_Windows_Forms_Form_" data-uid="C1.Win.TouchToolKit.C1ZoomAttachingEventArgs.#ctor(C1.Win.TouchToolKit.C1Zoom,System.Windows.Forms.Form)">
          <a class="xref" href="C1.Win.TouchToolKit.C1ZoomAttachingEventArgs.-ctor.html#C1_Win_TouchToolKit_C1ZoomAttachingEventArgs__ctor_C1_Win_TouchToolKit_C1Zoom_System_Windows_Forms_Form_">C1ZoomAttachingEventArgs(C1Zoom, Form)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Win.TouchToolKit.C1ZoomAttachingEventArgs.html">C1ZoomAttachingEventArgs</a> class.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_TouchToolKit_C1ZoomAttachingEventArgs_Cancel" data-uid="C1.Win.TouchToolKit.C1ZoomAttachingEventArgs.Cancel">
          <a class="xref" href="C1.Win.TouchToolKit.C1ZoomAttachingEventArgs.Cancel.html#C1_Win_TouchToolKit_C1ZoomAttachingEventArgs_Cancel">Cancel</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating whether this <a class="xref" href="C1.Win.TouchToolKit.C1ApplicationZoom.C1ZoomAttaching.html">C1ZoomAttaching</a> event is cancel.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1ZoomAttachingEventArgs_Form" data-uid="C1.Win.TouchToolKit.C1ZoomAttachingEventArgs.Form">
          <a class="xref" href="C1.Win.TouchToolKit.C1ZoomAttachingEventArgs.Form.html#C1_Win_TouchToolKit_C1ZoomAttachingEventArgs_Form">Form</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.form">Form</a> that is preparing be attached by <a class="xref" href="C1.Win.TouchToolKit.C1Zoom.html">C1Zoom</a> component.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1ZoomAttachingEventArgs_GcZoom" data-uid="C1.Win.TouchToolKit.C1ZoomAttachingEventArgs.GcZoom">
          <a class="xref" href="C1.Win.TouchToolKit.C1ZoomAttachingEventArgs.GcZoom.html#C1_Win_TouchToolKit_C1ZoomAttachingEventArgs_GcZoom">GcZoom</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the <a class="xref" href="C1.Win.TouchToolKit.C1Zoom.html">C1Zoom</a> component that is preparing attach to the <a class="xref" href="C1.Win.TouchToolKit.C1ZoomAttachingEventArgs.Form.html#C1_Win_TouchToolKit_C1ZoomAttachingEventArgs_Form">Form</a>.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
