Share via


PenInputPanel.CommitPendingInput Method

Deprecated. Sends collected ink to the recognizer and posts the the recognition result. PenInputPanel has been replaced by Microsoft.Ink.TextInput.

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

Syntax

'Declaration
<PermissionSetAttribute(SecurityAction.InheritanceDemand, Name := "FullTrust")> _
<UIPermissionAttribute(SecurityAction.Demand, Window := UIPermissionWindow.SafeTopLevelWindows)> _
<SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted := True)> _
Public Sub CommitPendingInput
'Usage
Dim instance As PenInputPanel

instance.CommitPendingInput()
[PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")]
[UIPermissionAttribute(SecurityAction.Demand, Window = UIPermissionWindow.SafeTopLevelWindows)]
[SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]
public void CommitPendingInput()
[PermissionSetAttribute(SecurityAction::InheritanceDemand, Name = L"FullTrust")]
[UIPermissionAttribute(SecurityAction::Demand, Window = UIPermissionWindow::SafeTopLevelWindows)]
[SecurityPermissionAttribute(SecurityAction::Demand, Unrestricted = true)]
public:
void CommitPendingInput()
public function CommitPendingInput()

Remarks

For western languages, the Handwriting panel sends the collected ink to the recognizer and clears the writing pad. For East Asian languages that use multiple boxes, the Handwriting panel sends recognized characters and clears the boxes. The recognition result is sent to the control to which the PenInputPanel object is attached.

If there is no pending input or the CurrentPanel property is Keyboard, CommitPendingInput does nothing.

If the PenInputPanel object is inactive, calling this method generates an error.

Starting with Microsoft® Windows® XP Tablet PC Edition 2005, ink is recognized as the user is entering. Therefore, the CommitPendingInput function sends the already recognized text to the edit control it does not force recognition to occur.

Starting with Windows XP Tablet PC Edition 2005, if the PenInputPanel object is inactive, CommitPendingInput does not generate an error, it simply returns.

Security noteSecurity Note:

If using under partial trust, this method requires SecurityPermissionFlag.AllFlags permission, in addition to the permissions required by PenInputPanel. See Security and Trust for more information.

Examples

This C# example creates a PenInputPanel object, thePenInputPanel, and attaches it to an InkEdit control, theInkEdit. It adds a VisibleChanged event handler, VisibleChanged_Event, to the form for the PenInputPanel. In the event handler, if the PenInputPanel object becomes invisible, any pending input is sent to the recognizer by calling the CommitPendingInput method.

[C#]

//...

// Declare the PenInputPanel object
PenInputPanel thePenInputPanel;

public Form1()
{
    // Required for Windows Form Designer support
    InitializeComponent();

    // Create and attach the new PenInputPanel to an InkEdit control.
    thePenInputPanel = new PenInputPanel(theInkEdit);

    // Add a PenInputPanelVisibleChanged event handler
    thePenInputPanel.VisibleChanged +=
        new PenInputPanelVisibleChangedEventHandler(VisibleChanged_Event);
}

//...

public void VisibleChanged_Event(object sender,
PenInputPanelVisibleChangedEventArgs e)
{
    // Make sure the object that generated
    // the event is a PenInputPanel object
    if (sender is PenInputPanel)
    {
        PenInputPanel theSenderPanel = (PenInputPanel)sender;

        // If the panel has become invisible...
        if (!e.NewVisibility)
        {
            // Send pending input to the recognizer
            theSenderPanel.CommitPendingInput();
        }
    }
}

This Microsoft Visual Basic® .NET example creates a PenInputPanel object, thePenInputPanel, and attaches it to an InkEdit control, theInkEdit. It adds a VisibleChanged event handler, VisibleChanged_Event, to the form for the PenInputPanel. In the event handler, if the PenInputPanel object becomes invisible, any pending input is sent to the recognizer by calling the CommitPendingInput method.

[Visual Basic]

'...

' Declare the PenInputPanel object
Dim thePenInputPanel As PenInputPanel

Public Sub New()
    MyBase.New()

    'This call is required by the Windows Form Designer.
    InitializeComponent()

    ' Create and attach the new PenInputPanel to an InkEdit control.
    thePenInputPanel = New PenInputPanel(theInkEdit)

    ' Add a PenInputPanelVisibleChanged event handler
    AddHandler thePenInputPanel.VisibleChanged, _
               AddressOf VisibleChanged_Event
End Sub 'New

'...

Public Sub VisibleChanged_Event(sender As Object, e As _
                                PenInputPanelVisibleChangedEventArgs)
    ' Make sure the object that generated
    ' the event is a PenInputPanel object
    If TypeOf sender Is PenInputPanel Then
       Dim theSenderPanel As PenInputPanel = CType(sender, PenInputPanel)

       ' If the panel has become invisible...
       If Not e.NewVisibility Then
          ' Send pending input to the recognizer
            theSenderPanel.CommitPendingInput()
       End If
    End If
End Sub 'VisibleChanged_Event

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

PenInputPanel Class

PenInputPanel Members

Microsoft.Ink Namespace

PenInputPanel.CurrentPanel

PenInputPanel.VisibleChanged