Bagikan melalui


InkCollector.InkCollector Constructor

InkCollector.InkCollector Constructor

Creates an InkCollector object, attaches it to the specified window handle, and determines whether to use the mouse for input.

Definition

Visual Basic .NET Public Sub InkCollector( _
ByVal handle As IntPtr, _
ByVal useMouseForInput As Boolean _
)
C# public InkCollector(
IntPtr handle,
bool useMouseForInput
);
Managed C++ public: InkCollector(
IntPtr *handle,
bool *useMouseForInput
);

Parameters

handle System.IntPtr. The handle of the window to which the InkCollector object is attached.
useMouseForInput System.Boolean. Set to true to use the mouse for tablet input; otherwise false.

Remarks

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

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

Examples

[C#]

This C# example initializes a new instance of the InkCollector object, theInkCollector, associates it with the window handle of the form, indicates that the mouse is not used for input, 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.
        theInkCollector = new InkCollector(Handle, false);
        theInkCollector.Enabled = true;
    }

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

[VB.NET]

This Microsoft® Visual Basic® .NET example initializes a new instance of the InkCollector object, theInkCollector, associates it with the window handle of the form, indicates that the mouse is not used for input, 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.
        theInkCollector = New InkCollector(Handle, False)
        theInkCollector.Enabled = True
    End Sub

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

See Also