# C1.Win.TouchToolKit.MagnifierEventArgs

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Win_TouchToolKit_MagnifierEventArgs" data-uid="C1.Win.TouchToolKit.MagnifierEventArgs" class="text-break">MagnifierEventArgs Class
</h1>
  <div class="markdown level0 summary"><p>Provides data for the <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.Closed.html">Closed</a> and <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.Move.html">Move</a>
event.</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">MagnifierEventArgs</span></div>
      <div class="level3"><a class="xref" href="C1.Win.TouchToolKit.MagnifierShowingEventArgs.html">MagnifierShowingEventArgs</a></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.4.8.dll</h6>
  <h5 id="C1_Win_TouchToolKit_MagnifierEventArgs_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class MagnifierEventArgs : EventArgs</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class MagnifierEventArgs
    Inherits EventArgs</code></pre>
  </div>
  <h5 id="C1_Win_TouchToolKit_MagnifierEventArgs_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>
The <a class="xref" href="C1.Win.TouchToolKit.MagnifierEventArgs.html">MagnifierEventArgs</a> contains information regarding position 
and target control before the magnifier popup.
</p>
</div>
  <h5 id="C1_Win_TouchToolKit_MagnifierEventArgs_examples"><strong>Examples</strong></h5>
  <p>
  The following code example shows how to use <a class="xref" href="C1.Win.TouchToolKit.MagnifierEventArgs.html">MagnifierEventArgs</a> class. 
</p>
<pre><code class="lang-csharp">public class GcMagnifierEventDemo : Form
{
	private TextBox _magnifierTextBox;
	private GcMagnifier _gcMagnifierObj = new GcMagnifier();

	public GcMagnifierEventDemo()
	{
		InitializeComponent();

		_gcMagnifierObj.SetEnableMagnifier(_magnifierTextBox, true);
		_gcMagnifierObj.Move += _gcMagnifierObj_Move;
		_gcMagnifierObj.Closed += _gcMagnifierObj_Closed;
		_gcMagnifierObj.MagnifierShowing += _gcMagnifierObj_MagnifierShowing;
	}

	void _gcMagnifierObj_Move(object sender, MagnifierEventArgs e)
	{
		Console.WriteLine(e.TargetControl.ToString());
		Console.WriteLine(e.Position.ToString());
	}

	void _gcMagnifierObj_Closed(object sender, MagnifierEventArgs e)
	{
		Console.WriteLine(e.TargetControl.ToString());
		Console.WriteLine(e.Position.ToString());
	}

	void _gcMagnifierObj_MagnifierShowing(object sender, MagnifierEventArgs e)
	{
		Console.WriteLine(e.TargetControl.ToString());
		Console.WriteLine(e.Position.ToString());
	}

	private void InitializeComponent()
	{
		_magnifierTextBox = new TextBox();
		_magnifierTextBox.Text = "This is a TextBox";
		_magnifierTextBox.Location = new Point(20, 20);
		_magnifierTextBox.Size = new Size(160, 20);
		this.Controls.Add(_magnifierTextBox);
	}
}</code></pre>
<pre><code class="lang-csharp">Public Class GcMagnifierEventDemo
	Inherits Form
	Private _magnifierTextBox As TextBox
	Private _gcMagnifierObj As New GcMagnifier()

	Public Sub New()
		InitializeComponent()

		_gcMagnifierObj.SetEnableMagnifier(_magnifierTextBox, True)
		AddHandler _gcMagnifierObj.Move, AddressOf _gcMagnifierObj_Move
		AddHandler _gcMagnifierObj.Closed, AddressOf _gcMagnifierObj_Closed
		AddHandler _gcMagnifierObj.MagnifierShowing, AddressOf _gcMagnifierObj_MagnifierShowing
	End Sub

	Private Sub _gcMagnifierObj_Move(sender As Object, e As MagnifierEventArgs)
		Console.WriteLine(e.TargetControl.ToString())
		Console.WriteLine(e.Position.ToString())
	End Sub

	Private Sub _gcMagnifierObj_Closed(sender As Object, e As MagnifierEventArgs)
		Console.WriteLine(e.TargetControl.ToString())
		Console.WriteLine(e.Position.ToString())
	End Sub

	Private Sub _gcMagnifierObj_MagnifierShowing(sender As Object, e As MagnifierEventArgs)
		Console.WriteLine(e.TargetControl.ToString())
		Console.WriteLine(e.Position.ToString())
	End Sub

	Private Sub InitializeComponent()
		_magnifierTextBox = New TextBox()
		_magnifierTextBox.Text = "This is a TextBox"
		_magnifierTextBox.Location = New Point(20, 20)
		_magnifierTextBox.Size = New Size(160, 20)
		Me.Controls.Add(_magnifierTextBox)
	End Sub
End Class</code></pre>

  <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_MagnifierEventArgs_Position" data-uid="C1.Win.TouchToolKit.MagnifierEventArgs.Position">
          <a class="xref" href="C1.Win.TouchToolKit.MagnifierEventArgs.Position.html#C1_Win_TouchToolKit_MagnifierEventArgs_Position">Position</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value indicating the position.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_MagnifierEventArgs_TargetControl" data-uid="C1.Win.TouchToolKit.MagnifierEventArgs.TargetControl">
          <a class="xref" href="C1.Win.TouchToolKit.MagnifierEventArgs.TargetControl.html#C1_Win_TouchToolKit_MagnifierEventArgs_TargetControl">TargetControl</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the target object which magnifier shows on it.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
