PenInputPanel.EnableTsf Method
Deprecated. Indicates whether or not the PenInputPanel object attempts to send text to the attached control through the Text Services Framework (TSF) and enables the use of the correction user interface. PenInputPanel has been replaced by Microsoft.Ink.TextInput.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Syntax
'Declaration
<UIPermissionAttribute(SecurityAction.Demand, Window := UIPermissionWindow.SafeTopLevelWindows)> _
<SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted := True)> _
<PermissionSetAttribute(SecurityAction.InheritanceDemand, Name := "FullTrust")> _
Public Sub EnableTsf ( _
enable As Boolean _
)
'Usage
Dim instance As PenInputPanel
Dim enable As Boolean
instance.EnableTsf(enable)
[UIPermissionAttribute(SecurityAction.Demand, Window = UIPermissionWindow.SafeTopLevelWindows)]
[SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]
[PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")]
public void EnableTsf(
bool enable
)
[UIPermissionAttribute(SecurityAction::Demand, Window = UIPermissionWindow::SafeTopLevelWindows)]
[SecurityPermissionAttribute(SecurityAction::Demand, Unrestricted = true)]
[PermissionSetAttribute(SecurityAction::InheritanceDemand, Name = L"FullTrust")]
public:
void EnableTsf(
bool enable
)
public function EnableTsf(
enable : boolean
)
Parameters
enable
Type: System.BooleanA Boolean variable that indicates whether or not the PenInputPanel object attempts to send text to the attached control through the Text Services Framework (TSF) and enables the use of the correction user interface.
If true, the PenInputPanel object attempts to send text to the attached control through the Text Services Framework (TSF), and the correction user interface is enabled.
If false, the PenInputPanel object attempts to disable TSF on the attached control. The correction user interface is unavailable.
Remarks
Calling this method with the enable parameter set to true causes the PenInputPanel object to attempt to start the TSF on the attached control.
Note
Support has been added to TSF and to provide a consistent user interface for all applications across the desktop. This new support enables legacy applications or controls that are not aware of TSF to take advantage of some advanced text services. For example, speech dictation and handwriting can now be used to enter text into a document in any application.
This new feature is available and enabled by default on Microsoft® Windows® XP Tablet PC Edition. To enable or disable the feature:
1. In Control Panel, click Regional and Language Options.
2. On the Languages tab, click Details.
3. On the Advanced tab of the Text Services and Input Languages dialog box, select or clear Extend support of advanced text services to all programs.
If successful, text is sent to the attached control through TSF. Furthermore, if the control supports TSF (and is not receiving text from TSF only because Advanced Text Services is enabled, as in the previous procedure), then the correction user interface appears in the control with access to handwriting alternates. Calling this method with the enable parameter set to false causes the PenInputPanel object to attempt to disable TSF on the attached control.
Use the EnableTsf method to enable the PenInputPanel to use the TSF insertion context rather than SendInput Function to send the handwriting recognition results into the control. By enabling the PenInputPanel to use the TSF insertion context, text can be inserted even if the field no longer has focus.
When you call this method with the enable parameter set to true, the PenInputPanel object sends an EM_SETEDITSTYLE message to the attached control. If the control does not support this message, results may be unpredictable.
The InkEdit control does support TSF.
Security Note: |
---|
If using under partial trust, this method requires SecurityPermissionFlag.AllFlags permission, in addition to the permissions required by PenInputPanel. See Security and Trust for more information. |
Examples
This C# example attaches a PenInputPanel object, thePenInputPanel, to an InkEdit control, theInkEdit. The EnableTsf method is called on the PenInputPanel to start the TSF.
[C#]
// Declare, create, and attach a new
// PenInputPanel to an InkEdit control.
PenInputPanel thePenInputPanel = new PenInputPanel(theInkEdit);
// Start the Text Services Framework
thePenInputPanel.EnableTsf(true);
This Microsoft Visual Basic® .NET example attaches a PenInputPanel object, thePenInputPanel, to an InkEdit control, theInkEdit. The EnableTsf method is called on the PenInputPanel to start the TSF.
[Visual Basic]
'Declare, create, and attach a new
'PenInputPanel to an InkEdit control.
Dim thePenInputPanel As New PenInputPanel(theInkEdit)
'Start the Text Services Framework
thePenInputPanel.EnableTsf(True)
Platforms
Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.0