Condividi tramite


Evento PenInputPanel.InputFailed

Aggiornamento: novembre 2007

Obsoleto. Si verifica quando lo stato attivo dell'input cambia prima che l'oggetto PenInputPanel sia in grado di inserire l'input dell'utente nel controllo associato. L'oggetto PenInputPanel è stato sostituito dall'oggetto Microsoft.Ink.TextInput.

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

Sintassi

'Dichiarazione
Public Event InputFailed As PenInputPanelInputFailedEventHandler
'Utilizzo
Dim instance As PenInputPanel
Dim handler As PenInputPanelInputFailedEventHandler

AddHandler instance.InputFailed, handler
public event PenInputPanelInputFailedEventHandler InputFailed
public:
 event PenInputPanelInputFailedEventHandler^ InputFailed {
    void add (PenInputPanelInputFailedEventHandler^ value);
    void remove (PenInputPanelInputFailedEventHandler^ value);
}
/** @event */
public void add_InputFailed (PenInputPanelInputFailedEventHandler value)
/** @event */
public void remove_InputFailed (PenInputPanelInputFailedEventHandler value)
JScript non supporta gli eventi.

Note

Il gestore eventi riceve un argomento di tipo PenInputPanelInputFailedEventArgs contenente i dati relativi a questo evento.

L'evento InputFailed si verifica quando lo stato attivo dell'input cambia prima dell'inserimento dell'input dell'utente nel controllo associato. Ad esempio, se l'utente immette input penna nel riquadro scrittura, quindi colpisce un altro controllo di modifica prima del completamento del riconoscimento, viene generato questo evento.

Tramite l'handle della finestra passato in questo evento, è possibile scegliere di inserire il testo manualmente quando si verifica questo evento.

ms567738.alert_caution(it-it,VS.90).gifNota importante:

A partire da Microsoft® Windows® XP Tablet PC Edition 2005, l'evento InputFailed non viene più applicato. Il testo viene sempre inserito prima che lo stato attivo cambi.

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

Se utilizzato in attendibilità parziale, questo evento richiede l'autorizzazione SecurityPermissionFlag.AllFlags, oltre alle autorizzazioni richieste dall'oggetto PenInputPanel. Vedere Security and Trust.

Esempi

In questo esempio di C# vengono creati due oggetti PenInputPanel, thePenInputPanel1 e thePenInputPanel2, che vengono associati ai controlli TextBox, textBox1 e textBox2. Nell'esempio viene aggiunto un oggetto PenInputPanelInputFailedEventHandler, InputFailed_Event, a ciascun oggetto PenInputPanel. Nel gestore eventi, se lo stato attivo viene modificato, il testo viene impostato nel controllo TextBox precedente mediante l'impostazione della relativa proprietà Text.

//...

// Declare PenInputPanel objects
PenInputPanel thePenInputPanel1;
PenInputPanel thePenInputPanel2;

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

    // Create, and attach new PenInputPanels to a TextBox controls.
    thePenInputPanel1 = new PenInputPanel(textBox1);
    thePenInputPanel2 = new PenInputPanel(textBox2);

    // Add an InputFailed event handler to each PenInputPanel
    thePenInputPanel1.InputFailed +=
        new PenInputPanelInputFailedEventHandler(InputFailed_Event);

    thePenInputPanel2.InputFailed +=
        new PenInputPanelInputFailedEventHandler(InputFailed_Event);
}

//...

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

        // Set the text in the previous control
        theSenderPanel.AttachedEditControl.Text += e.Text;
    }
}

In questo esempio di Microsoft Visual Basic® .NET vengono creati due oggetti PenInputPanel, thePenInputPanel1 e thePenInputPanel2, che vengono associati ai controlli TextBox, textBox1 e textBox2. Nell'esempio viene aggiunto un oggetto PenInputPanelInputFailedEventHandler, InputFailed_Event, a ciascun oggetto PenInputPanel. Nel gestore eventi, se lo stato attivo viene modificato, il testo viene impostato nel controllo TextBox precedente mediante l'impostazione della relativa proprietà Text.

'...

' Declare the PenInputPanel objects
Dim thePenInputPanel1 As PenInputPanel
Dim thePenInputPanel2 As PenInputPanel

Public Sub New()
    MyBase.New()

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

    ' Create and attach new PenInputPanels to a TextBox controls.
    thePenInputPanel1 = New PenInputPanel(TextBox1)
    thePenInputPanel2 = New PenInputPanel(TextBox2)

    ' Add an InputFailed event handler to each PenInputPanel
    AddHandler thePenInputPanel1.InputFailed, AddressOf InputFailed_Event
    AddHandler thePenInputPanel2.InputFailed, AddressOf InputFailed_Event
End Sub 'New

'...

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

        ' Set the text in the previous control
        thePenInputPanel.AttachedEditControl.Text += e.Text
    End If
End Sub 'InputFailed_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.OnInputFailed