Поделиться через


PenInputPanel.InputFailed - событие

Обновлен: Ноябрь 2007

Deprecated. Occurs when focus for input changes before the PenInputPanel object is able to insert user input into the attached control. PenInputPanel has been replaced by Microsoft.Ink.TextInput.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
Public Event InputFailed As PenInputPanelInputFailedEventHandler
'Применение
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 не поддерживает события.

Заметки

The event handler receives an argument of type PenInputPanelInputFailedEventArgs containing data about this event.

The InputFailed event occurs when input focus changes before user input was inserted into the attached control. For example, if the user enters ink into the writing pad, then taps another edit control before the recognizer has had a chance to finish, this event fires.

By using the window handle passed into this event, you can choose to insert the text manually when this event occurs.

ms567738.alert_caution(ru-ru,VS.90).gifВажное примечание.

Starting with Microsoft® Windows® XP Tablet PC Edition 2005, the InputFailed event no longer applies. Text is always inserted before focus changes.

ms567738.alert_security(ru-ru,VS.90).gifПримечание о безопасности.

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

Примеры

This C# example creates two PenInputPanel objects, thePenInputPanel1 and thePenInputPanel2, and attaches them to TextBox controls, textBox1 and textBox2. The example adds a PenInputPanelInputFailedEventHandler, InputFailed_Event, to each PenInputPanel object. In the event handler, if focus has changed, the text is set in the previous TextBox control by setting its Text property.

//...

// 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;
    }
}

This Microsoft Visual Basic® .NET example creates two PenInputPanel objects, thePenInputPanel1 and thePenInputPanel2, and attaches them to TextBox controls, textBox1 and textBox2. The example adds a PenInputPanelInputFailedEventHandler, InputFailed_Event, to each PenInputPanel object. In the event handler, if focus has changed, the text is set in the previous TextBox control by setting its Text property.

'...

' 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

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

PenInputPanel Класс

PenInputPanel - члены

Microsoft.Ink - пространство имен

PenInputPanel.OnInputFailed