# C1.Win.TouchToolKit.C1ZoomPanel.ScrollLocation

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_TouchToolKit_C1ZoomPanel_ScrollLocation_" data-uid="C1.Win.TouchToolKit.C1ZoomPanel.ScrollLocation*">ScrollLocation Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_TouchToolKit_C1ZoomPanel_ScrollLocation_" data-uid="C1.Win.TouchToolKit.C1ZoomPanel.ScrollLocation*"></a>
<h4 id="C1_Win_TouchToolKit_C1ZoomPanel_ScrollLocation" data-uid="C1.Win.TouchToolKit.C1ZoomPanel.ScrollLocation">ScrollLocation</h4>
<div class="markdown level1 summary"><p>Gets or sets the scroll location of the panel.</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 Point ScrollLocation { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">&lt;Browsable(False)&gt;
Public Property ScrollLocation As Point</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.drawing.point">Point</a></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.point">Point</a> value that represents the scroll location of the panel in pixels.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_TouchToolKit_C1ZoomPanel_ScrollLocation_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>
The <a class="xref" href="C1.Win.TouchToolKit.C1ZoomPanel.ScrollLocation.html#C1_Win_TouchToolKit_C1ZoomPanel_ScrollLocation">ScrollLocation</a> property represents the location of the visible portion of a the panel. 
Use this property to change the portion of the control that is displayed.
</p>
<p>
<div class="NOTE"><h5>note</h5><p>
The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.point.x">X</a> and <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.point.y">Y</a> coordinate values retrieved are negative 
if the control has scrolled away from its starting position (0,0). When you set this property, 
you must always assign positive <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.point.x">X</a> and <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.point.y">Y</a> values to set 
the scroll position relative to the starting position. For example, if you have a horizontal 
scroll bar and you set x and y to 200, you move the scroll 200 pixels to the right; if you 
then set x and y to 100, the scroll appears to jump the left by 100 pixels, because you are 
setting it 100 pixels away from the starting position. In the first case, <a class="xref" href="C1.Win.TouchToolKit.C1ZoomPanel.ScrollLocation.html#C1_Win_TouchToolKit_C1ZoomPanel_ScrollLocation">ScrollLocation</a> 
returns {-200, 0}; in the second case, it returns {-100,0}.
</p></div>

<p>
If the set value bigger than scrollable maximum value, the <a class="xref" href="C1.Win.TouchToolKit.C1ZoomPanel.ScrollLocation.html#C1_Win_TouchToolKit_C1ZoomPanel_ScrollLocation">ScrollLocation</a> will adjust the value 
to maximum value automatically. And also, if the set value smaller than scrollable minimum value, the 
<a class="xref" href="C1.Win.TouchToolKit.C1ZoomPanel.ScrollLocation.html#C1_Win_TouchToolKit_C1ZoomPanel_ScrollLocation">ScrollLocation</a> will adjust the value to minimum value automatically.
</p>
</div>
<h5 id="C1_Win_TouchToolKit_C1ZoomPanel_ScrollLocation_examples">Examples</h5>
<p>
  The following code example shows how to use this property. 
</p>
<p>
  This code example is part of a larger example provided for the <a class="xref" href="C1.Win.TouchToolKit.C1Zoom.ScrollIndicatorMode.html#C1_Win_TouchToolKit_C1Zoom_ScrollIndicatorMode">ScrollIndicatorMode</a> property. 
</p>
<pre><code class="lang-csharp">public class GcZoomScrollDemo : Form
{
	private Button _scrollButton;
	private GcZoom _gcZoom1 = new GcZoom();

	public GcZoomScrollDemo()
	{
		InitializeComponent();

		_gcZoom1.Target = this;

		_scrollButton.Click += _scrollButton_Click;
	}

	void _scrollButton_Click(object sender, EventArgs e)
	{
		_gcZoom1.ScrollLocation = new Point(0, 0);
	}

	private void InitializeComponent()
	{
		_scrollButton = new Button();
		_scrollButton.Size = new Size(200, 25);
		_scrollButton.Text = "Scroll to (0, 0)";
		_scrollButton.Location = new Point(20, 110);
		this.Controls.Add(_scrollButton);
	}
}</code></pre>
<pre><code class="lang-csharp">Public Class GcZoomScrollDemo
	Inherits Form
	Private _scrollButton As Button
	Private _gcZoom1 As New GcZoom()

	Public Sub New()
		InitializeComponent()

		_gcZoom1.Target = Me

		AddHandler _scrollButton.Click, AddressOf _scrollButton_Click
	End Sub

	Private Sub _scrollButton_Click(sender As Object, e As EventArgs)
		_gcZoom1.ScrollLocation = New Point(0, 0)
	End Sub

	Private Sub InitializeComponent()
		_scrollButton = New Button()
		_scrollButton.Size = New Size(200, 25)
		_scrollButton.Text = "Scroll to (0, 0)"
		_scrollButton.Location = New Point(20, 110)
		Me.Controls.Add(_scrollButton)
	End Sub
End Class</code></pre>

</div>
