# C1.Win.TouchToolKit.C1Zoom.SetScrollLocation

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_TouchToolKit_C1Zoom_SetScrollLocation_" data-uid="C1.Win.TouchToolKit.C1Zoom.SetScrollLocation*">SetScrollLocation Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_TouchToolKit_C1Zoom_SetScrollLocation_" data-uid="C1.Win.TouchToolKit.C1Zoom.SetScrollLocation*"></a>
<h4 id="C1_Win_TouchToolKit_C1Zoom_SetScrollLocation_System_Drawing_Point_System_Boolean_" data-uid="C1.Win.TouchToolKit.C1Zoom.SetScrollLocation(System.Drawing.Point,System.Boolean)">SetScrollLocation(Point, bool)</h4>
<div class="markdown level1 summary"><p>Sets the <a class="xref" href="C1.Win.TouchToolKit.C1Zoom.ScrollLocation.html#C1_Win_TouchToolKit_C1Zoom_ScrollLocation">ScrollLocation</a> and determines whether use animation when change <a class="xref" href="C1.Win.TouchToolKit.C1Zoom.ScrollLocation.html#C1_Win_TouchToolKit_C1Zoom_ScrollLocation">ScrollLocation</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void SetScrollLocation(Point scrollLocation, bool useAnimation = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub SetScrollLocation(scrollLocation As Point, Optional useAnimation As Boolean = False)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.point">Point</a></td>
      <td><span class="parametername">scrollLocation</span></td>
      <td><p>The scroll location.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">useAnimation</span></td>
      <td><p>true to use animation; otherwise, false.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_TouchToolKit_C1Zoom_SetScrollLocation_System_Drawing_Point_System_Boolean__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.AnimationStartingEventArgs.html">AnimationStartingEventArgs</a> class.
</p>
<pre><code class="lang-csharp">class GcZoomAnimationDemo : Form
{
	private Button _scrollRightBtn = new Button();
	private GcZoom _gcZoom1 = new GcZoom();

	public GcZoomAnimationDemo()
	{
		InitializeComponent();

		_gcZoom1.Target = this;

		_scrollRightBtn.Click += _scrollRightBtn_Click;
	}

	void _scrollRightBtn_Click(object sender, EventArgs e)
	{
		_gcZoom1.SetScrollLocation(new Point(-1000, 0), true);
	}

	private void InitializeComponent()
	{
		this._scrollRightBtn.Location = new System.Drawing.Point(12, 100);
		this._scrollRightBtn.Size = new System.Drawing.Size(260, 30);
		this._scrollRightBtn.Text = "Scroll Right";
		this.Controls.Add(this._scrollRightBtn);
	}
}</code></pre>
<pre><code class="lang-csharp">Class GcZoomAnimationDemo
	Inherits Form
	Private _scrollRightBtn As New Button()
	Private _gcZoom1 As New GcZoom()

	Public Sub New()
		InitializeComponent()

		_gcZoom1.Target = Me

		AddHandler _scrollRightBtn.Click, AddressOf _scrollRightBtn_Click
	End Sub

	Private Sub _scrollRightBtn_Click(sender As Object, e As EventArgs)
		_gcZoom1.SetScrollLocation(New Point(-1000, 0), True)
	End Sub

	Private Sub InitializeComponent()
		Me._scrollRightBtn.Location = New System.Drawing.Point(12, 100)
		Me._scrollRightBtn.Size = New System.Drawing.Size(260, 30)
		Me._scrollRightBtn.Text = "Scroll Right"
		Me.Controls.Add(Me._scrollRightBtn)
	End Sub
End Class</code></pre>

</div>
