Compartir a través de


InkCollector.InkCollector(IntPtr, Tablet) Constructor

Creates an InkCollector object and attaches it to a specified window handle on a specified tablet.

Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)

Syntax

'Declaration
Public Sub New ( _
    handle As IntPtr, _
    tablet As Tablet _
)
'Usage
Dim handle As IntPtr
Dim tablet As Tablet

Dim instance As New InkCollector(handle, tablet)
public InkCollector (
    IntPtr handle,
    Tablet tablet
)
public:
InkCollector (
    IntPtr handle, 
    Tablet^ tablet
)
public InkCollector (
    IntPtr handle, 
    Tablet tablet
)
public function InkCollector (
    handle : IntPtr, 
    tablet : Tablet
)
Not applicable.

Parameters

  • handle
    The handle of the window to which the InkCollector object is attached.
  • tablet
    The Tablet object to which the new window of the InkCollector object is attached.

Remarks

The newly created InkCollector object can collect ink on the specified window surface.

Depending on which Tablet is chosen, the pen or the mouse may be used for input.

Security noteSecurity Note:

If using under partial trust, this constructor requires SecurityPermissionFlag.UnmanagedCodeSecurityPermissionFlag.UnmanagedCode permission, in addition to the permissions required by InkCollector. See Security And Trust for more information.

Example

This C# example initializes a new instance of the InkCollector object, theInkCollector, associates it with the window handle of the form and the default Tablet, and then enables it.

using System;
using System.Drawing;
using System.Windows.Forms;
using Microsoft.Ink;

class MinimumInkApp : System.Windows.Forms.Form
{
InkCollector theInkCollector;

public MinimumInkApp()
{
 // Initialize the form.
 this.Text = "Minimum Ink Application";

 // Create and enable theInkCollector.
 Tablets allTablets = new Tablets();
 theInkCollector = new InkCollector(Handle, allTablets.DefaultTablet);
 theInkCollector.Enabled = true;
}

public static void Main()
{
 Application.Run(new MinimumInkApp());
}
}

This Microsoft Visual Basic .NET example initializes a new instance of the InkCollector object, theInkCollector, associates it with the window handle of the form and the default Tablet, and then enables it.

Imports System.Windows.Forms
Imports Microsoft.Ink
Public Class MinimumInkApp
Inherits System.Windows.Forms.Form

Dim theInkCollector As InkCollector

Public Sub New()
 MyBase.New()
 'Initialize the form.
 Me.Text = "Minimum Ink Application"
 
 'Create and enable theInkCollector.
 Dim allTablets As New Tablets()
 theInkCollector = New InkCollector(Handle, allTablets.DefaultTablet)
 theInkCollector.Enabled = True
End Sub

Public Shared Sub Main()
 Application.Run(New MinimumInkApp())
End Sub
End Class

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkCollector Class
InkCollector Members
Microsoft.Ink Namespace
InkCollector