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消息替换为多行或将TextBox其追加到多行。To 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 Form1的类型的实例的项目中。To 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属性设置true为。To 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)

适用于

另请参阅