TextInputPanel.TextInserting 事件

在 Tablet PC 输入面板即将把文本插入有输入焦点的控件时发生。

命名空间:  Microsoft.Ink.TextInput
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
Public Event TextInserting As EventHandler(Of TextInsertionEventArgs)
用法
Dim instance As TextInputPanel
Dim handler As EventHandler(Of TextInsertionEventArgs)

AddHandler instance.TextInserting, handler
public event EventHandler<TextInsertionEventArgs> TextInserting
public:
 event EventHandler<TextInsertionEventArgs^>^ TextInserting {
    void add (EventHandler<TextInsertionEventArgs^>^ value);
    void remove (EventHandler<TextInsertionEventArgs^>^ value);
}
/** @event */
public void add_TextInserting (EventHandler<TextInsertionEventArgs> value)
/** @event */
public void remove_TextInserting (EventHandler<TextInsertionEventArgs> value)
JScript 不支持事件。

示例

下面的两个示例演示如何使用 TextInserting。

第一个示例将 TextInserting 事件处理程序 tip_TextInserting 附加到 TextInputPanel 对象 tip。

AddHandler tip.TextInserting, AddressOf tip_TextInserting
tip.TextInserting += new EventHandler<TextInsertionEventArgs>(tip_TextInserting);

第二个示例定义 TextInserting 事件的事件处理程序,其中表示包含在 Ink 数组(表示输入面板文本插入)中的 Strokes 集合的前几位 RecognitionResult 对象的字符串值用于设置 TextBox (outputTextBox) 的 TextBox.Text 属性。

Sub tip_TextInserting(ByVal sender As Object, ByVal e As TextInsertionEventArgs)
    outputTextBox.Text += "Inserting Text: " + Environment.NewLine
    Dim inkArray As Microsoft.Ink.Ink() = e.GetInk()
    Dim ink As Microsoft.Ink.Ink
    For Each ink In inkArray
        outputTextBox.Text += ink.Strokes.ToString()
    Next ink
    outputTextBox.Text += Environment.NewLine
End Sub
void tip_TextInserting(object sender, TextInsertionEventArgs e)
{
    outputTextBox.Text += "Inserting Text: " + Environment.NewLine;
    Microsoft.Ink.Ink[] inkArray = e.GetInk();
    foreach (Microsoft.Ink.Ink ink in inkArray)
    {
        outputTextBox.Text += ink.Strokes.ToString();
    }
    outputTextBox.Text += Environment.NewLine;
}

平台

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

TextInputPanel 类

TextInputPanel 成员

Microsoft.Ink.TextInput 命名空间