Partager via


InkOverlay.InkOverlay Constructor

InkOverlay.InkOverlay Constructor

Initializes a new instance of the InkOverlay class and attaches it to a specified window handle on a specified Tablet object.

Definition

Visual Basic .NET Public Sub InkOverlay( _
ByVal handle As IntPtr, _
ByVal tablet As Tablet _
)
C# public InkOverlay(
IntPtr handle,
Tablet tablet
);
Managed C++ public: InkOverlay(
IntPtr *handle,
Tablet *tablet
);

Parameters

handle System.IntPtr. The handle of the window to which the InkOverlay object is attached.
tablet Microsoft.Ink.Tablet. The Tablet object to which the new window for the InkOverlay object is attached.

Remarks

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

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

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

Examples

[C#]

This C# example initializes a new instance of the InkOverlay object, theInkOverlay, 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
{
    InkOverlay theInkOverlay;

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

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

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

[VB.NET]

This Microsoft® Visual Basic® .NET example initializes a new instance of the InkOverlay object, theInkOverlay, 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 theInkOverlay As InkOverlay

    Public Sub New()
        MyBase.New()
        'Initialize the form.
        Me.Text = "Minimum Ink Application"

        'Create and enable theInkOverlay.
        Dim allTablets As New Tablets()
        theInkOverlay = New InkOverlay(Handle, allTablets.DefaultTablet)
        theInkOverlay.Enabled = True
    End Sub

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

See Also