InputLanguageChangingEventArgs InputLanguageChangingEventArgs InputLanguageChangingEventArgs InputLanguageChangingEventArgs Class

定义

InputLanguageChanging 事件提供数据。Provides data for the InputLanguageChanging event.

public ref class InputLanguageChangingEventArgs : System::ComponentModel::CancelEventArgs
public class InputLanguageChangingEventArgs : System.ComponentModel.CancelEventArgs
type InputLanguageChangingEventArgs = class
    inherit CancelEventArgs
Public Class InputLanguageChangingEventArgs
Inherits CancelEventArgs
继承
InputLanguageChangingEventArgsInputLanguageChangingEventArgsInputLanguageChangingEventArgsInputLanguageChangingEventArgs

示例

下面的代码示例演示如何使用此类型。The following code example demonstrates the use of this type. 在示例中,事件处理程序报告的匹配项InputLanguageChanging事件。In the example, an event handler reports on the occurrence of the InputLanguageChanging event. 此报告可帮助您了解事件发生的并可以帮助您进行调试。This report helps you to learn when the event occurs and can assist you in debugging. 若要报告或频繁发生的事件上多个事件,请考虑更换ShowConsole.WriteLine或将消息附加到多行TextBoxTo report on multiple events or on events that occur frequently, consider replacing Show with Console.WriteLine or appending the message to a multiline TextBox.

若要运行此代码示例,请将其粘贴到包含类型的实例的项目Form名为Form1To run the example code, paste it into a project that contains an instance of type Form named Form1. 然后,确保事件处理程序相关联InputLanguageChanging事件。Then ensure that the event handler is associated with the InputLanguageChanging event.

private void Form1_InputLanguageChanging(Object sender, InputLanguageChangingEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "InputLanguage", e.InputLanguage );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Culture", e.Culture );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "SysCharSet", e.SysCharSet );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Cancel", e.Cancel );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "InputLanguageChanging Event" );
}
Private Sub Form1_InputLanguageChanging(sender as Object, e as InputLanguageChangingEventArgs) _ 
     Handles Form1.InputLanguageChanging

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "InputLanguage", e.InputLanguage)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Culture", e.Culture)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "SysCharSet", e.SysCharSet)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Cancel", e.Cancel)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"InputLanguageChanging Event")

End Sub

注解

可以使用来自数据InputLanguageChangingEventArgs类若要准备将更改输入法编辑器 (IME) 文件或交换右到左值。You can use the data from the InputLanguageChangingEventArgs class to prepare to change Input Method Editors (IME) or swap right-to-left values. 您还可以更改线程的CurrentCultureCurrentUICulture属性以便获取不同的资源。You can also change a thread's CurrentCulture and CurrentUICulture properties so that different resources get picked up. 若要防止更改输入的语言,请设置Cancel属性设置为trueTo prevent the input language from changing, set the Cancel property to true.

InputLanguageChangingEventArgs标识请求的输入的语言和新的输入语言的字符集。An InputLanguageChangingEventArgs identifies the requested input language and the character set of new input language. Culture属性标识的请求的语言区域设置。The Culture property identifies the locale of the requested language.

InputLanguageChanging事件之前InputLanguageChanged事件。The InputLanguageChanging event precedes the InputLanguageChanged event.

有关处理事件的信息,请参阅处理和引发事件For information about handling events, see Handling and Raising Events.

构造函数

InputLanguageChangingEventArgs(CultureInfo, Boolean) InputLanguageChangingEventArgs(CultureInfo, Boolean) InputLanguageChangingEventArgs(CultureInfo, Boolean) InputLanguageChangingEventArgs(CultureInfo, Boolean)

使用指定的区域设置、字符集和接受性初始化 InputLanguageChangingEventArgs 类的新实例。Initializes a new instance of the InputLanguageChangingEventArgs class with the specified locale, character set, and acceptance.

InputLanguageChangingEventArgs(InputLanguage, Boolean) InputLanguageChangingEventArgs(InputLanguage, Boolean) InputLanguageChangingEventArgs(InputLanguage, Boolean) InputLanguageChangingEventArgs(InputLanguage, Boolean)

用指定的输入语言、字符集和接受对语言的更改来初始化 InputLanguageChangingEventArgs 类的新实例。Initializes a new instance of the InputLanguageChangingEventArgs class with the specified input language, character set, and acceptance of a language change.

属性

Cancel Cancel Cancel Cancel

获取或设置指示是否应取消事件的值。Gets or sets a value indicating whether the event should be canceled.

(Inherited from CancelEventArgs)
Culture Culture Culture Culture

获取请求的输入语言的区域设置。Gets the locale of the requested input language.

InputLanguage InputLanguage InputLanguage InputLanguage

获取指示输入语言的值。Gets a value indicating the input language.

SysCharSet SysCharSet SysCharSet SysCharSet

获取一个值,该值指示系统默认字体是否支持请求的输入语言所要求的字符集。Gets a value indicating whether the system default font supports the character set required for the requested input language.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

适用于

另请参阅