PenInputPanel.CommitPendingInput 方法
已否决。将所收集的墨迹 发送到识别器,并发布识别结果。PenInputPanel 已由 Microsoft.Ink.TextInput 替换。
命名空间: Microsoft.Ink
程序集: Microsoft.Ink(在 Microsoft.Ink.dll 中)
语法
声明
<PermissionSetAttribute(SecurityAction.InheritanceDemand, Name := "FullTrust")> _
<UIPermissionAttribute(SecurityAction.Demand, Window := UIPermissionWindow.SafeTopLevelWindows)> _
<SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted := True)> _
Public Sub CommitPendingInput
用法
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()
备注
对于西方语言,手写 面板将收集到的墨迹发送到识别器,并清除书写板。对于使用多个框的东亚语言,手写 面板发送已识别的字符,并清除这些框。识别结果将发送到 PenInputPanel 对象所附加到的控件。
如果没有挂起的输入,或者 CurrentPanel 属性是 Keyboard,则 CommitPendingInput 不执行任何操作。
如果 PenInputPanel 对象处于不活动状态,则调用该方法会生成错误。
从 Microsoft(R) Windows(R) XP Tablet PC Edition 2005 开始,墨迹 是在用户输入时识别的。因此,CommitPendingInput 函数将已识别的文本发送到未强制执行识别操作的编辑控件。
从 Windows XP Tablet PC Edition 2005 开始,如果 PenInputPanel 对象处于不活动状态,则 CommitPendingInput 不生成错误,而是直接返回。
安全说明: |
---|
如果在部分信任环境下使用,则除了 PenInputPanel 所需的权限以外,该方法还需要 SecurityPermissionFlag.AllFlags 权限。有关更多信息,请参见Security and Trust。 |
示例
此 C# 示例创建 PenInputPanel 对象 thePenInputPanel,并将它附加到 InkEdit 控件 theInkEdit。它将一个 VisibleChanged 事件处理程序 VisibleChanged_Event 添加到 PenInputPanel 的窗体。在该事件处理程序中,如果 PenInputPanel 对象变为不可见,则通过调用 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();
}
}
}
此 Microsoft Visual Basic(R) .NET 示例创建 PenInputPanel 对象 thePenInputPanel,并将它附加到 InkEdit 控件 theInkEdit。它将一个 VisibleChanged 事件处理程序 VisibleChanged_Event 添加到 PenInputPanel 的窗体。在该事件处理程序中,如果 PenInputPanel 对象变为不可见,则通过调用 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
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.0