# C1.Win.TouchToolKit.HoldingEventArgs

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Win_TouchToolKit_HoldingEventArgs" data-uid="C1.Win.TouchToolKit.HoldingEventArgs" class="text-break">HoldingEventArgs Class
</h1>
  <div class="markdown level0 summary"><p>Provides data for <a class="xref" href="C1.Win.TouchToolKit.C1TouchEventProvider.Holding.html">Holding</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"><a class="xref" href="C1.Win.TouchToolKit.TouchRoutedEventArgs.html">TouchRoutedEventArgs</a></div>
    <div class="level3"><span class="xref">HoldingEventArgs</span></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_HoldingEventArgs_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class HoldingEventArgs : TouchRoutedEventArgs</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class HoldingEventArgs
    Inherits TouchRoutedEventArgs</code></pre>
  </div>
  <h5 id="C1_Win_TouchToolKit_HoldingEventArgs_examples"><strong>Examples</strong></h5>
  <p>
  The following code example shows how to use <a class="xref" href="C1.Win.TouchToolKit.HoldingEventArgs.html">HoldingEventArgs</a> class. 
</p>
<p>
  This code example is part of a larger example provided for the <a class="xref" href="C1.Win.TouchToolKit.C1TouchEventProvider.html">C1TouchEventProvider</a> class.
</p>
<pre><code class="lang-csharp">public class GcTouchEventProviderDemo : Form
{
	private Panel _bluePanel;
	private ListBox _messageListBox;
	private GcTouchEventProvider _gcTouchEventProvider = new GcTouchEventProvider();

	public GcTouchEventProviderDemo()
	{
		InitializeComponent();

		// Enable all manipulation interaction modes.
		_gcTouchEventProvider.ManipulationMode = ManipulationModes.All;

		// EnablePressAndHold and EnablePenFlicks property default value is True;

		// Attach GcTouchEventprovider to Panel.
		_gcTouchEventProvider.SetEnableTouchEvents(_bluePanel, true);

		_gcTouchEventProvider.Holding += _gcTouchEventProvider_Holding;
	}

	private void _gcTouchEventProvider_Holding(object sender, HoldingEventArgs e)
	{
		string log = "Target: " + e.TargetControl.Name + " Event: Holding" + "  X: " + e.Position.X.ToString() + " Y:" + e.Position.Y.ToString();
		_messageListBox.Items.Add(log);
	}

	private void InitializeComponent()
	{
		_bluePanel = new Panel();
		_bluePanel.Name = "Blue";
		_bluePanel.BackColor = Color.Blue;
		_bluePanel.Size = new Size(200, 200);
		_bluePanel.Location = new Point(20, 20);

		_messageListBox = new ListBox();
		_messageListBox.Size = new Size(750, 310);
		_messageListBox.Location = new Point(20, 240);

		this.Controls.Add(_bluePanel);
		this.Controls.Add(_messageListBox);
	}
}</code></pre>
<pre><code class="lang-csharp">Public Class GcTouchEventProviderDemo
	Inherits Form
	Private _bluePanel As Panel
	Private _messageListBox As ListBox
	Private _gcTouchEventProvider As New GcTouchEventProvider()

	Public Sub New()
		InitializeComponent()

		' Enable all manipulation interaction modes.
		_gcTouchEventProvider.ManipulationMode = ManipulationModes.All

		' EnablePressAndHold and EnablePenFlicks property default value is True;

		' Attach GcTouchEventprovider to Panel.
		_gcTouchEventProvider.SetEnableTouchEvents(_bluePanel, True)

		AddHandler _gcTouchEventProvider.Holding, AddressOf _gcTouchEventProvider_Holding
	End Sub

	Private Sub _gcTouchEventProvider_Holding(sender As Object, e As HoldingEventArgs)
		Dim log As String = "Target: " &amp; Convert.ToString(e.TargetControl.Name) &amp; " Event: Holding" &amp; "  X: " &amp; e.Position.X.ToString() &amp; " Y:" &amp; e.Position.Y.ToString()
		_messageListBox.Items.Add(log)
	End Sub

	Private Sub InitializeComponent()
		_bluePanel = New Panel()
		_bluePanel.Name = "Blue"
		_bluePanel.BackColor = Color.Blue
		_bluePanel.Size = New Size(200, 200)
		_bluePanel.Location = New Point(20, 20)

		_messageListBox = New ListBox()
		_messageListBox.Size = New Size(750, 310)
		_messageListBox.Location = New Point(20, 240)

		Me.Controls.Add(_bluePanel)
		Me.Controls.Add(_messageListBox)
	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_HoldingEventArgs_HoldingState" data-uid="C1.Win.TouchToolKit.HoldingEventArgs.HoldingState">
          <a class="xref" href="C1.Win.TouchToolKit.HoldingEventArgs.HoldingState.html#C1_Win_TouchToolKit_HoldingEventArgs_HoldingState">HoldingState</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the underlying <a class="xref" href="C1.Win.TouchToolKit.HoldingEventArgs.HoldingState.html#C1_Win_TouchToolKit_HoldingEventArgs_HoldingState">HoldingState</a> for the interaction</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_HoldingEventArgs_PointerDeviceType" data-uid="C1.Win.TouchToolKit.HoldingEventArgs.PointerDeviceType">
          <a class="xref" href="C1.Win.TouchToolKit.HoldingEventArgs.PointerDeviceType.html#C1_Win_TouchToolKit_HoldingEventArgs_PointerDeviceType">PointerDeviceType</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the <a class="xref" href="C1.Win.TouchToolKit.HoldingEventArgs.PointerDeviceType.html#C1_Win_TouchToolKit_HoldingEventArgs_PointerDeviceType">PointerDeviceType</a> for the pointer device that initiated the associated input event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_TouchToolKit_HoldingEventArgs_Position" data-uid="C1.Win.TouchToolKit.HoldingEventArgs.Position">
          <a class="xref" href="C1.Win.TouchToolKit.HoldingEventArgs.Position.html#C1_Win_TouchToolKit_HoldingEventArgs_Position">Position</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the x- and y- control coordinates of the pointer position.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
