This topic has not yet been rated - Rate this topic

InputMethod Class

Provides facilities for managing and interacting with the Text Services Framework, which provides support for alternate text input methods such as speech and handwriting.

System.Object
  System.Windows.Threading.DispatcherObject
    System.Windows.Input.InputMethod

Namespace:  System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)
public class InputMethod : DispatcherObject

The InputMethod type exposes the following members.

  Name Description
Public property CanShowConfigurationUI Gets a value that indicates whether or not this input method can display configuration user interface (UI).
Public property CanShowRegisterWordUI Gets a value that indicates whether this input method can display word registration user interface (UI). 
Public property Static member Current Gets a reference to any currently active input method associated with the current context.
Public property Dispatcher Gets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.)
Public property HandwritingState Gets or sets the current state of handwriting input for this input method.
Public property ImeConversionMode Gets or sets the current conversion mode for the input method editor associated with this input method.
Public property ImeSentenceMode Gets or sets the current sentence mode for the input method editor associated with this input method.
Public property ImeState Gets or sets the current state of the input method editor associated with this input method.
Public property MicrophoneState Gets or sets the current state of microphone input for this input method.
Public property SpeechMode Gets or sets the speech mode for this input method.
Top
  Name Description
Public attached property InputScope Gets or sets the input scope for a specified dependency object.
Public attached property IsInputMethodEnabled Gets or sets a value that indicates whether this input method is enabled.
Public attached property IsInputMethodSuspended Gets or sets a value that indicates whether this input method is suspended.
Public attached property PreferredImeConversionMode Gets or sets a preferred ImeConversionModeValues value for a specified dependency object.
Public attached property PreferredImeSentenceMode Gets or sets a preferred ImeSentenceModeValues value for a specified dependency object.
Public attached property PreferredImeState Gets or sets a preferred input method state for a specified dependency object.
Top
  Name Description
Public method CheckAccess Determines whether the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method Static member GetInputScope Returns the value of the InputScope  attached property for a specified dependency object.
Public method Static member GetIsInputMethodEnabled Returns the value of the IsInputMethodEnabled  attached property for a specified dependency object.
Public method Static member GetIsInputMethodSuspended Returns the value of the IsInputMethodSuspended  attached property for a specified dependency object.
Public method Static member GetPreferredImeConversionMode Returns the value of the PreferredImeConversionMode  attached property for a specified dependency object.
Public method Static member GetPreferredImeSentenceMode Returns the value of the PreferredImeSentenceMode  attached property for a specified dependency object.
Public method Static member GetPreferredImeState Returns the value of the PreferredImeState  attached property for a specified dependency object.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Static member SetInputScope Sets the value of the InputScope attached property on the specified dependency object.
Public method Static member SetIsInputMethodEnabled Sets the value of the IsInputMethodEnabled attached property on the specified dependency object.
Public method Static member SetIsInputMethodSuspended Sets the value of the IsInputMethodSuspended attached property on the specified dependency object.
Public method Static member SetPreferredImeConversionMode Sets the value of the PreferredImeConversionMode attached property on the specified dependency object.
Public method Static member SetPreferredImeSentenceMode Sets the value of the PreferredImeSentenceMode attached property on the specified dependency object.
Public method Static member SetPreferredImeState Sets the value of the PreferredImeState attached property on the specified dependency object.
Public method ShowConfigureUI() Displays configuration user interface (UI) associated with the currently active keyboard text service.
Public method ShowConfigureUI(UIElement) Displays configuration user interface (UI) associated with the currently active keyboard text service, using a specified UIElement as the parent element for the configuration UI.
Public method ShowRegisterWordUI() Displays word registration user interface (UI) associated with the currently active keyboard text service.
Public method ShowRegisterWordUI(String) Displays word registration user interface (UI) associated with the currently active keyboard text service. Accepts a specified string as the default value to register.
Public method ShowRegisterWordUI(UIElement, String) Displays word registration user interface (UI) associated with the currently active keyboard text service. Accepts a specified string as the default value to register, and a specified UIElement as the parent element for the configuration UI.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method VerifyAccess Enforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Top
  Name Description
Public event StateChanged Occurs when the input method state (represented by the ImeState property) changes.
Top
  Name Description
Public field Static member InputScopeProperty Identifies the InputScope attached property.
Public field Static member IsInputMethodEnabledProperty Identifies the IsInputMethodEnabled attached property.
Public field Static member IsInputMethodSuspendedProperty Identifies the IsInputMethodSuspended attached property.
Public field Static member PreferredImeConversionModeProperty Identifies the PreferredImeConversionMode attached property.
Public field Static member PreferredImeSentenceModeProperty Identifies the PreferredImeSentenceMode attached property.
Public field Static member PreferredImeStateProperty Identifies the PreferredImeState attached property.
Top

The following example demonstrates how to use an InputMethod object.


InputMethod.SetPreferredImeState(myTextBox, InputMethodState.On);
InputMethod.Current.ImeSentenceMode = ImeSentenceModeValues.Automatic;
InputMethod.Current.HandwritingState = InputMethodState.On;
InputMethod.Current.SpeechMode = SpeechMode.Dictation;
InputScope myInputScope = new InputScope();
myInputScope.RegularExpression = "W|P|F";
InputMethod.SetInputScope(myTextBox, myInputScope);
tb6.Text = "Configuration UI Available?: " + InputMethod.Current.CanShowConfigurationUI.ToString();


.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ