# C1.Win.TouchToolKit.C1ZoomCommandProvider.GetZoomCommands

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_TouchToolKit_C1ZoomCommandProvider_GetZoomCommands_" data-uid="C1.Win.TouchToolKit.C1ZoomCommandProvider.GetZoomCommands*">GetZoomCommands Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_TouchToolKit_C1ZoomCommandProvider_GetZoomCommands_" data-uid="C1.Win.TouchToolKit.C1ZoomCommandProvider.GetZoomCommands*"></a>
<h4 id="C1_Win_TouchToolKit_C1ZoomCommandProvider_GetZoomCommands_System_Windows_Forms_IButtonControl_" data-uid="C1.Win.TouchToolKit.C1ZoomCommandProvider.GetZoomCommands(System.Windows.Forms.IButtonControl)">GetZoomCommands(IButtonControl)</h4>
<div class="markdown level1 summary"><p>Retrieves the <a class="xref" href="C1.Win.TouchToolKit.C1ZoomCommandProvider.html">C1ZoomCommandProvider</a> associated with the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.ibuttoncontrol">IButtonControl</a> or not.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ZoomCommands GetZoomCommands(IButtonControl control)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetZoomCommands(control As IButtonControl) As ZoomCommands</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.windows.forms.ibuttoncontrol">IButtonControl</a></td>
      <td><span class="parametername">control</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.ibuttoncontrol">IButtonControl</a> for which to retrieve the <a class="xref" href="C1.Win.TouchToolKit.C1ZoomCommandProvider.html">C1ZoomCommandProvider</a>.</p>
</td>
    </tr>
  </tbody>
</table>
<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="C1.Win.TouchToolKit.ZoomCommands.html">ZoomCommands</a></td>
      <td><p><a class="xref" href="C1.Win.TouchToolKit.ZoomCommands.html">ZoomCommands</a> object, indicating the Build-in command.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_TouchToolKit_C1ZoomCommandProvider_GetZoomCommands_System_Windows_Forms_IButtonControl__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.C1ZoomCommandProvider.html">C1ZoomCommandProvider</a> class.
</p>
<pre><code class="lang-csharp">public class MyUserControl : UserControl
{
	private GcZoomCommandProvider commands = new GcZoomCommandProvider();
	private Button _zoomInButton;
	private Button _zoomOutButton;

	public MyUserControl()
	{
		InitializeComponent();

		commands.Target = this;
		commands.SetZoomCommands(_zoomInButton, ZoomCommands.ZoomIn);
		Console.WriteLine(commands.GetZoomCommands(_zoomInButton).ToString());

		commands.SetZoomCommands(_zoomOutButton, ZoomCommands.ZoomOut);
		Console.WriteLine(commands.GetZoomCommands(_zoomOutButton).ToString());
	}

	private void InitializeComponent()
	{
		_zoomInButton = new Button();
		_zoomInButton.Text = "+";
		_zoomInButton.Size = new Size(40, 40);
		_zoomInButton.Location = new Point(10, 10);

		_zoomOutButton = new Button();
		_zoomOutButton.Text = "_";
		_zoomOutButton.Size = new Size(40, 40);
		_zoomOutButton.Location = new Point(60, 10);

		this.Controls.Add(_zoomInButton);
		this.Controls.Add(_zoomOutButton);
	}
}</code></pre>
<pre><code class="lang-csharp">Public Class MyUserControl
	Inherits UserControl
	Private commands As New GcZoomCommandProvider()
	Private _zoomInButton As Button
	Private _zoomOutButton As Button

	Public Sub New()
 		InitializeComponent()

		commands.Target = Me
		commands.SetZoomCommands(_zoomInButton, ZoomCommands.ZoomIn)
		Console.WriteLine(commands.GetZoomCommands(_zoomInButton).ToString())

		commands.SetZoomCommands(_zoomOutButton, ZoomCommands.ZoomOut)
		Console.WriteLine(commands.GetZoomCommands(_zoomOutButton).ToString())
	End Sub

	Private Sub InitializeComponent()
 		_zoomInButton = New Button()
 		_zoomInButton.Text = "+"
 		_zoomInButton.Size = New Size(40, 40)
 		_zoomInButton.Location = New Point(10, 10)

 		_zoomOutButton = New Button()
 		_zoomOutButton.Text = "_"
 		_zoomOutButton.Size = New Size(40, 40)
 		_zoomOutButton.Location = New Point(60, 10)

 		Me.Controls.Add(_zoomInButton)
 		Me.Controls.Add(_zoomOutButton)
	End Sub
End Class</code></pre>

</div>
