Skip to main content
.NET Framework Class Library
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.

Namespace:   System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)
Syntax
Public Class InputMethod _
	Inherits [%$TOPIC/ms617141_en-us_VS_110_2_0_0_0_0%]
public class InputMethod : [%$TOPIC/ms617141_en-us_VS_110_2_0_1_0_0%]
public ref class InputMethod : public [%$TOPIC/ms617141_en-us_VS_110_2_0_2_0_0%]
type InputMethod =  
    class 
        inherit [%$TOPIC/ms617141_en-us_VS_110_2_0_3_0_0%] 
    end

The InputMethod type exposes the following members.

Properties
  NameDescription
Public property CanShowConfigurationUIGets a value that indicates whether or not this input method can display configuration user interface (UI).
Public property CanShowRegisterWordUIGets a value that indicates whether this input method can display word registration user interface (UI). 
Public property Static member CurrentGets a reference to any currently active input method associated with the current context.
Public property DispatcherGets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.)
Public property HandwritingStateGets or sets the current state of handwriting input for this input method.
Public property ImeConversionModeGets or sets the current conversion mode for the input method editor associated with this input method.
Public property ImeSentenceModeGets or sets the current sentence mode for the input method editor associated with this input method.
Public property ImeStateGets or sets the current state of the input method editor associated with this input method.
Public property MicrophoneStateGets or sets the current state of microphone input for this input method.
Public property SpeechModeGets or sets the speech mode for this input method.
Top
Attached Properties
  NameDescription
Public attached property InputScopeGets or sets the input scope for a specified dependency object.
Public attached property IsInputMethodEnabledGets or sets a value that indicates whether this input method is enabled.
Public attached property IsInputMethodSuspendedGets or sets a value that indicates whether this input method is suspended.
Public attached property PreferredImeConversionModeGets or sets a preferred ImeConversionModeValues value for a specified dependency object.
Public attached property PreferredImeSentenceModeGets or sets a preferred ImeSentenceModeValues value for a specified dependency object.
Public attached property PreferredImeStateGets or sets a preferred input method state for a specified dependency object.
Top
Methods
  NameDescription
Public method CheckAccessDetermines 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 FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public method Static member GetInputScopeReturns the value of the InputScope  attached property for a specified dependency object.
Public method Static member GetIsInputMethodEnabledReturns the value of the IsInputMethodEnabled  attached property for a specified dependency object.
Public method Static member GetIsInputMethodSuspendedReturns the value of the IsInputMethodSuspended  attached property for a specified dependency object.
Public method Static member GetPreferredImeConversionModeReturns the value of the PreferredImeConversionMode  attached property for a specified dependency object.
Public method Static member GetPreferredImeSentenceModeReturns the value of the PreferredImeSentenceMode  attached property for a specified dependency object.
Public method Static member GetPreferredImeStateReturns the value of the PreferredImeState  attached property for a specified dependency object.
Public method GetTypeGets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public method Static member SetInputScopeSets the value of the InputScope attached property on the specified dependency object.
Public method Static member SetIsInputMethodEnabledSets the value of the IsInputMethodEnabled attached property on the specified dependency object.
Public method Static member SetIsInputMethodSuspendedSets the value of the IsInputMethodSuspended attached property on the specified dependency object.
Public method Static member SetPreferredImeConversionModeSets the value of the PreferredImeConversionMode attached property on the specified dependency object.
Public method Static member SetPreferredImeSentenceModeSets the value of the PreferredImeSentenceMode attached property on the specified dependency object.
Public method Static member SetPreferredImeStateSets the value of the PreferredImeState attached property on the specified dependency object.
Public method ShowConfigureUIDisplays 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 ShowRegisterWordUIDisplays 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 ToStringReturns a string that represents the current object. (Inherited from Object.)
Public method VerifyAccessEnforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Top
Events
  NameDescription
Public event StateChangedOccurs when the input method state (represented by the ImeState property) changes.
Top
Fields
  NameDescription
Public field Static member InputScopePropertyIdentifies the InputScope attached property.
Public field Static member IsInputMethodEnabledPropertyIdentifies the IsInputMethodEnabled attached property.
Public field Static member IsInputMethodSuspendedPropertyIdentifies the IsInputMethodSuspended attached property.
Public field Static member PreferredImeConversionModePropertyIdentifies the PreferredImeConversionMode attached property.
Public field Static member PreferredImeSentenceModePropertyIdentifies the PreferredImeSentenceMode attached property.
Public field Static member PreferredImeStatePropertyIdentifies the PreferredImeState attached property.
Top
Examples

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
				Dim myInputScope As New InputScope()
				myInputScope.RegularExpression = "W|P|F"
				InputMethod.SetInputScope(myTextBox, myInputScope)
				tb6.Text = "Configuration UI Available?: " & InputMethod.Current.CanShowConfigurationUI.ToString()
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();
Version Information

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.