# C1.Win.TouchToolKit.C1Magnify

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Win_TouchToolKit_C1Magnify" data-uid="C1.Win.TouchToolKit.C1Magnify" class="text-break">C1Magnify Class
</h1>
  <div class="markdown level0 summary"><p>Represents the component which can be attached to any existing control,
after long tap on the control, a magnifier will popup above the finger,
and shows the info around the finger.</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.marshalbyrefobject">MarshalByRefObject</a></div>
    <div class="level2"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.component">Component</a></div>
    <div class="level3"><span class="xref">C1Magnify</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.icomponent">IComponent</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.iextenderprovider">IExtenderProvider</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.10.dll</h6>
  <h5 id="C1_Win_TouchToolKit_C1Magnify_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[ToolboxBitmap(typeof(C1Magnify), &quot;C1Magnify.png&quot;)]
public class C1Magnify : Component, IComponent, IDisposable, IExtenderProvider</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">&lt;ToolboxBitmap(GetType(C1Magnify), &quot;C1Magnify.png&quot;)&gt;
Public Class C1Magnify
    Inherits Component
    Implements IComponent, IDisposable, IExtenderProvider</code></pre>
  </div>
  <h5 id="C1_Win_TouchToolKit_C1Magnify_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>
A form can attach two or more <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.html">C1Magnify</a> component, if has
two or more fingers long tap on the attach control, only first magnifier popup.
</p>
</div>
  <h5 id="C1_Win_TouchToolKit_C1Magnify_examples"><strong>Examples</strong></h5>
  <p>
  The following code example shows how to use <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.html">C1Magnify</a> component. 
</p>
<p>
  You can copy the code to a exsit Windows Forms appliction. And set the form in the sample code as start form. 
</p>
<p>
  If you find a licenses error when run this code. Try to drag a <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.html">C1Magnify</a> component to a 
  any Form from tool box can generate the licenses information to this project.
</p>
<pre><code class="lang-csharp">public class GcMagnifierDemo : Form
{
	private TextBox _magnifierTextBox;
	private GcMagnifier _gcMagnifierObj = new GcMagnifier();

	public GcMagnifierDemo()
	{
		InitializeComponent();

		// Enable GcMagnifier component to _firstTextBox.
		_gcMagnifierObj.SetEnableMagnifier(_magnifierTextBox, true);
		Console.WriteLine(_gcMagnifierObj.GetEnableMagnifier(_magnifierTextBox).ToString());

		// Set magnifier property
		SetGcMagnifier();
	}

	public void SetGcMagnifier()
	{
		// Set the duration from finger press to magnifier popup in millisecond
		_gcMagnifierObj.PopupDelay = 500;

		// Mouse right click message will be posted to the _firstTextBox when magnifier close
		_gcMagnifierObj.MessageWhenClose = MessageWhenClose.RightClick;

		// Mouse move message will be posted to the _firstTextBox when magnifier close
		 _gcMagnifierObj.MessageWhenMove = MessageWhenMove.Move;

		// Magnifier display the system cursor
		_gcMagnifierObj.ShowCursor = true;

		// Magnifier size in pixels
		_gcMagnifierObj.Size = new Size(100, 100);

		// Magnifier appearance
		_gcMagnifierObj.Shape = MagnifierShape.Rectangle;

		// Magnifier border width in pixels
		_gcMagnifierObj.BorderWidth = 10;

		// Magnifier background mode. If property value is BorderBackground.Custom,
		// user can to use BorderBackground property to set the background image.
		_gcMagnifierObj.BorderBackgroundMode = BorderBackground.Dark;

		// Magnifier zoom factor
		_gcMagnifierObj.ZoomFactor = 2f;

		// The magnifier will lock the move direction vertically and horizontally.
		_gcMagnifierObj.IsHorizontalRailEnabled = true;
		_gcMagnifierObj.IsVerticalRailEnabled = true;
	}

	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 GcMagnifierDemo
	Inherits Form
	Private _magnifierTextBox As TextBox
	Private _gcMagnifierObj As New GcMagnifier()

	Public Sub New()
		InitializeComponent()

		' Enable GcMagnifier component to _firstTextBox.
		_gcMagnifierObj.SetEnableMagnifier(_magnifierTextBox, True)
		Console.WriteLine(_gcMagnifierObj.GetEnableMagnifier(_magnifierTextBox).ToString())

		' Set magnifier property
		SetGcMagnifier()
	End Sub

	Public Sub SetGcMagnifier()
		' Set the duration from finger press to magnifier popup in millisecond
		_gcMagnifierObj.PopupDelay = 500

		' Mouse right click message will be posted to the _firstTextBox when magnifier close
		_gcMagnifierObj.MessageWhenClose = MessageWhenClose.RightClick

		' Mouse move message will be posted to the _firstTextBox when magnifier close
		_gcMagnifierObj.MessageWhenMove = MessageWhenMove.Move

		' Magnifier display the system cursor
		_gcMagnifierObj.ShowCursor = True

		' Magnifier size in pixels
		_gcMagnifierObj.Size = New Size(100, 100)

		' Magnifier appearance
		_gcMagnifierObj.Shape = MagnifierShape.Rectangle

		' Magnifier border width in pixels
		_gcMagnifierObj.BorderWidth = 10

		' Magnifier background mode. If property value is BorderBackground.Custom,
		' user can to use BorderBackground property to set the background image.
		_gcMagnifierObj.BorderBackgroundMode = BorderBackground.Dark

		' Magnifier zoom factor
		_gcMagnifierObj.ZoomFactor = 2.0F

		' The magnifier will lock the move direction vertically and horizontally.
		_gcMagnifierObj.IsHorizontalRailEnabled = True
		_gcMagnifierObj.IsVerticalRailEnabled = True
	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="constructors">Constructors
</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_C1Magnify__ctor" data-uid="C1.Win.TouchToolKit.C1Magnify.#ctor">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.-ctor.html#C1_Win_TouchToolKit_C1Magnify__ctor">C1Magnify()</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.html">C1Magnify</a> class.</p>
</td>
      </tr>
    </tbody>
  </table>
  <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_C1Magnify_BorderBackground" data-uid="C1.Win.TouchToolKit.C1Magnify.BorderBackground">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.BorderBackground.html#C1_Win_TouchToolKit_C1Magnify_BorderBackground">BorderBackground</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating the background image used for the border of the magnifier.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_BorderBackgroundMode" data-uid="C1.Win.TouchToolKit.C1Magnify.BorderBackgroundMode">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.BorderBackgroundMode.html#C1_Win_TouchToolKit_C1Magnify_BorderBackgroundMode">BorderBackgroundMode</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating the background mode used for the border of the magnifier.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_BorderWidth" data-uid="C1.Win.TouchToolKit.C1Magnify.BorderWidth">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.BorderWidth.html#C1_Win_TouchToolKit_C1Magnify_BorderWidth">BorderWidth</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating the border width of the magnifier in pixels.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_IsHorizontalRailEnabled" data-uid="C1.Win.TouchToolKit.C1Magnify.IsHorizontalRailEnabled">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.IsHorizontalRailEnabled.html#C1_Win_TouchToolKit_C1Magnify_IsHorizontalRailEnabled">IsHorizontalRailEnabled</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating whether the magnifier will lock the move direction horizontally.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_IsVerticalRailEnabled" data-uid="C1.Win.TouchToolKit.C1Magnify.IsVerticalRailEnabled">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.IsVerticalRailEnabled.html#C1_Win_TouchToolKit_C1Magnify_IsVerticalRailEnabled">IsVerticalRailEnabled</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating whether the magnifier will lock the move direction vertically.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_MessageWhenClose" data-uid="C1.Win.TouchToolKit.C1Magnify.MessageWhenClose">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.MessageWhenClose.html#C1_Win_TouchToolKit_C1Magnify_MessageWhenClose">MessageWhenClose</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating which message will be posted to the attach control when magnifier closed.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_MessageWhenMove" data-uid="C1.Win.TouchToolKit.C1Magnify.MessageWhenMove">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.MessageWhenMove.html#C1_Win_TouchToolKit_C1Magnify_MessageWhenMove">MessageWhenMove</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating which message will be posted to the attach control when magnifier is moving.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_PopupDelay" data-uid="C1.Win.TouchToolKit.C1Magnify.PopupDelay">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.PopupDelay.html#C1_Win_TouchToolKit_C1Magnify_PopupDelay">PopupDelay</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating the duration from finger press to magnifier popup in millisecond.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_Shape" data-uid="C1.Win.TouchToolKit.C1Magnify.Shape">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.Shape.html#C1_Win_TouchToolKit_C1Magnify_Shape">Shape</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating the appearance of the magnifier.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_ShowCursor" data-uid="C1.Win.TouchToolKit.C1Magnify.ShowCursor">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.ShowCursor.html#C1_Win_TouchToolKit_C1Magnify_ShowCursor">ShowCursor</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating whether system cursor is displayed in the magnifier.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_Size" data-uid="C1.Win.TouchToolKit.C1Magnify.Size">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.Size.html#C1_Win_TouchToolKit_C1Magnify_Size">Size</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating the size of the magnifier in pixels.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_ZoomFactor" data-uid="C1.Win.TouchToolKit.C1Magnify.ZoomFactor">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.ZoomFactor.html#C1_Win_TouchToolKit_C1Magnify_ZoomFactor">ZoomFactor</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating the zoom factor of the magnifier.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</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_C1Magnify_AboutBox" data-uid="C1.Win.TouchToolKit.C1Magnify.AboutBox">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.AboutBox.html#C1_Win_TouchToolKit_C1Magnify_AboutBox">AboutBox()</a>
        </td>
        <td class="markdown level1 summary"><p>Shows the product information window.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_CanExtend_System_Object_" data-uid="C1.Win.TouchToolKit.C1Magnify.CanExtend(System.Object)">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.CanExtend.html#C1_Win_TouchToolKit_C1Magnify_CanExtend_System_Object_">CanExtend(object)</a>
        </td>
        <td class="markdown level1 summary"><p>Specifies whether this object can provide its extender properties to the specified object.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_Dispose_System_Boolean_" data-uid="C1.Win.TouchToolKit.C1Magnify.Dispose(System.Boolean)">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.Dispose.html#C1_Win_TouchToolKit_C1Magnify_Dispose_System_Boolean_">Dispose(bool)</a>
        </td>
        <td class="markdown level1 summary"><p>Releases the unmanaged resources used by the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.component">Component</a> and optionally releases the managed resources.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_GetEnableMagnifier_System_Windows_Forms_Control_" data-uid="C1.Win.TouchToolKit.C1Magnify.GetEnableMagnifier(System.Windows.Forms.Control)">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.GetEnableMagnifier.html#C1_Win_TouchToolKit_C1Magnify_GetEnableMagnifier_System_Windows_Forms_Control_">GetEnableMagnifier(Control)</a>
        </td>
        <td class="markdown level1 summary"><p>Retrieves the <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.html">C1Magnify</a> associated with the specified control or not.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_OnClosed_C1_Win_TouchToolKit_MagnifierEventArgs_" data-uid="C1.Win.TouchToolKit.C1Magnify.OnClosed(C1.Win.TouchToolKit.MagnifierEventArgs)">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.OnClosed.html#C1_Win_TouchToolKit_C1Magnify_OnClosed_C1_Win_TouchToolKit_MagnifierEventArgs_">OnClosed(MagnifierEventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.Closed.html">Closed</a> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_OnMagnifierShowing_C1_Win_TouchToolKit_MagnifierShowingEventArgs_" data-uid="C1.Win.TouchToolKit.C1Magnify.OnMagnifierShowing(C1.Win.TouchToolKit.MagnifierShowingEventArgs)">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.OnMagnifierShowing.html#C1_Win_TouchToolKit_C1Magnify_OnMagnifierShowing_C1_Win_TouchToolKit_MagnifierShowingEventArgs_">OnMagnifierShowing(MagnifierShowingEventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.MagnifierShowing.html">MagnifierShowing</a> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_OnMove_C1_Win_TouchToolKit_MagnifierEventArgs_" data-uid="C1.Win.TouchToolKit.C1Magnify.OnMove(C1.Win.TouchToolKit.MagnifierEventArgs)">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.OnMove.html#C1_Win_TouchToolKit_C1Magnify_OnMove_C1_Win_TouchToolKit_MagnifierEventArgs_">OnMove(MagnifierEventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.Move.html">Move</a> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_SetEnableMagnifier_System_Windows_Forms_Control_System_Boolean_" data-uid="C1.Win.TouchToolKit.C1Magnify.SetEnableMagnifier(System.Windows.Forms.Control,System.Boolean)">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.SetEnableMagnifier.html#C1_Win_TouchToolKit_C1Magnify_SetEnableMagnifier_System_Windows_Forms_Control_System_Boolean_">SetEnableMagnifier(Control, bool)</a>
        </td>
        <td class="markdown level1 summary"><p>Associates <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.html">C1Magnify</a> with the specified control.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="events">Events
</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_C1Magnify_Closed" data-uid="C1.Win.TouchToolKit.C1Magnify.Closed">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.Closed.html">Closed</a>
        </td>
        <td class="markdown level1 summary"><p>Occurs when the magnifier is closed.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_MagnifierShowing" data-uid="C1.Win.TouchToolKit.C1Magnify.MagnifierShowing">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.MagnifierShowing.html">MagnifierShowing</a>
        </td>
        <td class="markdown level1 summary"><p>Occurs when the magnifier is opening.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_C1Magnify_Move" data-uid="C1.Win.TouchToolKit.C1Magnify.Move">
          <a class="xref" href="C1.Win.TouchToolKit.C1Magnify.Move.html">Move</a>
        </td>
        <td class="markdown level1 summary"><p>Occurs when the magnifier is moving.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
