Compartir a través de


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
Public Sub CommitPendingInput
'Usage
Dim instance As PenInputPanel

instance.CommitPendingInput
public void CommitPendingInput ()
public:
void CommitPendingInput ()
public void CommitPendingInput ()
public function CommitPendingInput ()
Not applicable.

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.

Example

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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

PenInputPanel Class
PenInputPanel Members
Microsoft.Ink Namespace
PenInputPanel.CurrentPanel
PenInputPanel.VisibleChanged