Creating a PenInputPanel Object

[PenInputPanel has been replaced by TextInputPanel and Microsoft.Ink.TextInput. Please refer to the Programming the Text Input Panel.]

Managed code constructors provide a convenient way to create a PenInputPanel object and attach it to a control in one step. This C# example creates a PenInputPanel object and attaches it to an existing InkEdit control, InkEdit1, with one line of code.

PenInputPanel thePenInputPanel = new PenInputPanel(InkEdit1);

The same example in Visual Basic .NET looks like this:

Dim thePenInputPanel As New PenInputPanel(InkEdit1)

This technique is useful in cases where one PenInputPanel object will be associated with a single control throughout its lifetime. In cases where you want to use one PenInputPanel object and associate it with multiple controls, as demonstrated in the PenInputPanel Sample, use the AttachedEditControl property to change the control to which the PenInputPanel object is associated.

To attach a PenInputPanel object to a control without using a constructor, use the AttachedEditControl property. Use this technique for languages that do not support the managed constructors, such as C++.