Condividi tramite


Metodo PenInputPanel.CommitPendingInput

Aggiornamento: novembre 2007

Obsoleto. Invia l'input penna raccolto al sistema di riconoscimento e inserisce il risultato del riconoscimento. L'oggetto PenInputPanel è stato sostituito dall'oggetto Microsoft.Ink.TextInput.

Spazio dei nomi:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Sintassi

'Dichiarazione
<PermissionSetAttribute(SecurityAction.InheritanceDemand, Name := "FullTrust")> _
<UIPermissionAttribute(SecurityAction.Demand, Window := UIPermissionWindow.SafeTopLevelWindows)> _
<SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted := True)> _
Public Sub CommitPendingInput
'Utilizzo
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()
/** @attribute PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust") */
/** @attribute UIPermissionAttribute(SecurityAction.Demand, Window = UIPermissionWindow.SafeTopLevelWindows) */
/** @attribute SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted = true) */
public void CommitPendingInput()
public function CommitPendingInput()

Note

Per le lingue occidentali, il pannello Riconoscimento grafia invia l'input penna raccolto al sistema di riconoscimento e cancella il riquadro scrittura. Per lingue dell'Asia orientale che utilizzano più caselle, il pannello Riconoscimento grafia invia i caratteri riconosciuti e cancella le caselle. Il risultato del riconoscimento viene inviato al controllo a cui è associato l'oggetto PenInputPanel.

Se non è presente nessun input in sospeso o la proprietà CurrentPanel è Keyboard, l'oggetto CommitPendingInput non esegue nessuna operazione.

Se l'oggetto PenInputPanel è inattivo, la chiamata a questo metodo genera un errore.

A partire da Microsoft® Windows® XP Tablet PC Edition 2005, l'input penna viene riconosciuto mentre l'utente sta eseguendo l'immissione. Pertanto, la funzione CommitPendingInput invia il testo già riconosciuto al controllo di modifica ma non impone l'esecuzione del riconoscimento.

A partire da Windows XP Tablet PC Edition 2005, se l'oggetto PenInputPanel è inattivo, l'oggetto CommitPendingInput non genera un errore, ma esegue semplicemente una restituzione.

ms569650.alert_security(it-it,VS.90).gifNota sulla sicurezza:

Se utilizzato in attendibilità parziale, questo metodo richiede l'autorizzazione SecurityPermissionFlag.AllFlags, oltre alle autorizzazioni richieste dall'oggetto PenInputPanel. Per ulteriori informazioni, vedere Security and Trust.

Esempi

In questo esempio di C# viene creato un oggetto PenInputPanel, thePenInputPanel, che viene associato a un controllo InkEdit, theInkEdit. Viene aggiunto un gestore eventi VisibleChanged, VisibleChanged_Event, al form dell'oggetto PenInputPanel. Nel gestore eventi, se l'oggetto PenInputPanel diventa invisibile, qualsiasi input in sospeso viene inviato al sistema di riconoscimento chiamando il metodo CommitPendingInput.

[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();
        }
    }
}

In questo esempio di Microsoft Visual Basic® .NET viene creato un oggetto PenInputPanel, thePenInputPanel, che viene associato a un controllo InkEdit, theInkEdit. Viene aggiunto un gestore eventi VisibleChanged, VisibleChanged_Event, al form dell'oggetto PenInputPanel. Nel gestore eventi, se l'oggetto PenInputPanel diventa invisibile, qualsiasi input in sospeso viene inviato al sistema di riconoscimento chiamando il metodo CommitPendingInput.

[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

Piattaforme

Windows Vista

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Framework

Supportato in: 3.0

Vedere anche

Riferimenti

PenInputPanel Classe

Membri PenInputPanel

Spazio dei nomi Microsoft.Ink

PenInputPanel.CurrentPanel

PenInputPanel.VisibleChanged