# C1.Win.TouchToolKit.C1ZoomPanel.AnimationStarting

## Content

<div class="doc-site-dotnet-api-container">




<h1 id="C1_Win_TouchToolKit_C1ZoomPanel_AnimationStarting" data-uid="C1.Win.TouchToolKit.C1ZoomPanel.AnimationStarting" class="text-break">AnimationStarting Event
</h1>
<div class="markdown level0 summary"><p>Occurs before <a class="xref" href="C1.Win.TouchToolKit.C1ZoomPanel.html">C1ZoomPanel</a> start animation.</p>
</div>
<div class="markdown level0 conceptual"></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_C1ZoomPanel_AnimationStarting_syntax">Syntax</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public event EventHandler&lt;AnimationStartingEventArgs&gt; AnimationStarting</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Event AnimationStarting As EventHandler(Of AnimationStartingEventArgs)</code></pre>
</div>
<h5 class="returns">Returns</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.eventhandler-1">EventHandler</a>&lt;<a class="xref" href="C1.Win.TouchToolKit.AnimationStartingEventArgs.html">AnimationStartingEventArgs</a>&gt;</td>
      <td>Occurs before  start animation.</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_TouchToolKit_C1ZoomPanel_AnimationStarting_examples"><strong>Examples</strong></h5>
<p>
  The following code example shows how to use this event.
</p>
<p>
  This code example is part of a larger example provided for the <a class="xref" href="C1.Win.TouchToolKit.AnimationStartingEventArgs.html">AnimationStartingEventArgs</a> class.
</p>
<pre><code class="lang-csharp">class GcZoomAnimationDemo : Form
{
	private GcZoom _gcZoom1 = new GcZoom();

	public GcZoomAnimationDemo()
	{
		_gcZoom1.Target = this;
		_gcZoom1.AnimationStarting += _gcZoom1_AnimationStarting;
	}

	void _gcZoom1_AnimationStarting(object sender, AnimationStartingEventArgs e)
	{
		if (_customizeDuringChB.Checked)
		{
			e.Duration = e.Duration * 4; // Make the animation slower.

			// e.Cancel = true;  // If it is necessary, cancel the animation by this code.
		}
		Console.WriteLine("+++ _gcZoom1_AnimationStarting +++");
		Console.WriteLine("CurrentScrollLocation:   " + e.CurrentScrollLocation.ToString());
		Console.WriteLine("CurrentZoomFactor:       " + e.CurrentZoomFactor.ToString());
		Console.WriteLine("TargetScrollLocation:    " + e.TargetScrollLocation.ToString());
		Console.WriteLine("TargetZoomFactor         " + e.TargetZoomFactor.ToString());
	}
}</code></pre>
<pre><code class="lang-csharp">Class GcZoomAnimationDemo
	Inherits Form
	Private _gcZoom1 As New GcZoom()

	Public Sub New()
		_gcZoom1.Target = Me
		AddHandler _gcZoom1.AnimationStarting, AddressOf _gcZoom1_AnimationStarting
	End Sub

	Private Sub _gcZoom1_AnimationStarting(sender As Object, e As AnimationStartingEventArgs)
		If _customizeDuringChB.Checked Then
			' Make the animation slower.
			' e.Cancel = true;  // If it is necessary, cancel the animation by this code.
			e.Duration = e.Duration * 4
		End If
		Console.WriteLine("+++ _gcZoom1_AnimationStarting +++")
		Console.WriteLine("CurrentScrollLocation:   " &amp; e.CurrentScrollLocation.ToString())
		Console.WriteLine("CurrentZoomFactor:       " &amp; e.CurrentZoomFactor.ToString())
		Console.WriteLine("TargetScrollLocation:    " &amp; e.TargetScrollLocation.ToString())
		Console.WriteLine("TargetZoomFactor         " &amp; e.TargetZoomFactor.ToString())
	End Sub
End Class</code></pre>

</div>
