Partager via


InkCollector.InkCollector Constructor

InkCollector.InkCollector Constructor

Initializes a new instance of the InkCollector class that is not yet associated with a window.

Definition

Visual Basic .NET Public Sub InkCollector()
C# public InkCollector();
Managed C++ public: InkCollector();

Remarks

Before collecting ink, an application must associate a window handle with the InkCollector object. To create an InkCollector object with an associated window handle, call the InkCollector(IntPtr) constructor.

In addition to the pen, the mouse can be used for input.

Examples

[C#]

This C# example initializes a new instance of the InkCollector object, theInkCollector, associates it with the window handle of the form, 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();
        theInkCollector.Handle = Handle;
        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, 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()
        theInkCollector.Handle = Handle
        theInkCollector.Enabled = True
    End Sub

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

See Also