InputLanguageChangedEventArgs InputLanguageChangedEventArgs InputLanguageChangedEventArgs InputLanguageChangedEventArgs Class

定义

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

public ref class InputLanguageChangedEventArgs : EventArgs
public class InputLanguageChangedEventArgs : EventArgs
type InputLanguageChangedEventArgs = class
    inherit EventArgs
Public Class InputLanguageChangedEventArgs
Inherits EventArgs
继承
InputLanguageChangedEventArgsInputLanguageChangedEventArgsInputLanguageChangedEventArgsInputLanguageChangedEventArgs

示例

下面的示例创建一个新Form的, 并将事件处理程序InputLanguageChanged附加到事件。The following example creates a new Form and attaches an event handler to the InputLanguageChanged event. 当输入语言更改IMEmode为日语时, 此事件将更改。This event changes the IMEmode when the input language changes to Japanese.

#using <System.Data.dll>
#using <System.Windows.Forms.dll>
#using <System.dll>
#using <System.Drawing.dll>

using namespace System;
using namespace System::Drawing;
using namespace System::Collections;
using namespace System::ComponentModel;
using namespace System::Windows::Forms;
using namespace System::Data;
public ref class Form1: public System::Windows::Forms::Form
{
private:
   RichTextBox^ rtb;

public:
   Form1()
   {
      rtb = gcnew RichTextBox;
      this->Controls->Add( rtb );
      rtb->Dock = DockStyle::Fill;
      this->InputLanguageChanged += gcnew InputLanguageChangedEventHandler( this, &Form1::languageChange );
   }


private:
   void languageChange( Object^ /*sender*/, InputLanguageChangedEventArgs^ e )
   {
      
      // If the input language is Japanese.
      // set the initial IMEMode to Katakana.
      if ( e->InputLanguage->Culture->TwoLetterISOLanguageName->Equals( "ja" ) )
      {
         rtb->ImeMode = System::Windows::Forms::ImeMode::Katakana;
      }
   }

};

int main()
{
   Application::Run( gcnew Form1 );
}

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

public class Form1 : System.Windows.Forms.Form
{
	RichTextBox rtb = new RichTextBox();
	public Form1()
	{
		this.Controls.Add(rtb);
		rtb.Dock = DockStyle.Fill;
		this.InputLanguageChanged += new InputLanguageChangedEventHandler(languageChange);
	}
	private void languageChange(Object sender, InputLanguageChangedEventArgs e)
	{
		// If the input language is Japanese.
		// set the initial IMEMode to Katakana.
		if (e.InputLanguage.Culture.TwoLetterISOLanguageName.Equals("ja"))
		{
			rtb.ImeMode = System.Windows.Forms.ImeMode.Katakana;
		}
	}
	public static void Main(string[] args)
	{
		Application.Run(new Form1());
	}
}
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data

Public Class Form1
   Inherits System.Windows.Forms.Form
   
   Dim WithEvents rtb As New RichTextBox()
   
   Public Sub New()
      MyBase.New()
      Me.Controls.Add(rtb)
      rtb.Dock = DockStyle.Fill
   End Sub

   Private Sub languageChange( _
      ByVal sender As Object, _
      ByVal e As InputLanguageChangedEventArgs _
   ) Handles MyBase.InputLanguageChanged

      ' If the input language is Japanese.
      ' set the initial IMEMode to Katakana.
      If e.InputLanguage.Culture.TwoLetterISOLanguageName.Equals("ja") = True Then
         rtb.ImeMode = System.Windows.Forms.ImeMode.Katakana
      End If
   End Sub

   Public Shared Sub Main()
      Application.Run(new Form1())
   End Sub

End Class

注解

您可以使用中InputLanguageChangedEventArgs的数据来决定是否更改输入法编辑器 (ime) 或交换从右到左的值。You can use the data from the InputLanguageChangedEventArgs to make decisions about whether to change Input Method Editors (IMEs) or swap right-to-left values. 还可以更改CurrentCulture线程CurrentUICulture和属性的, 以便选取不同的资源。You can also change the CurrentCulture of a thread and the CurrentUICulture properties so that different resources get picked up.

InputLanguageChangedEventArgs标识新输入语言的区域设置和字符集。An InputLanguageChangedEventArgs identifies the locale and the character set of the new input language.

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

构造函数

InputLanguageChangedEventArgs(CultureInfo, Byte) InputLanguageChangedEventArgs(CultureInfo, Byte) InputLanguageChangedEventArgs(CultureInfo, Byte) InputLanguageChangedEventArgs(CultureInfo, Byte)

用指定的区域设置和字符集初始化 InputLanguageChangedEventArgs 类的新实例。Initializes a new instance of the InputLanguageChangedEventArgs class with the specified locale and character set.

InputLanguageChangedEventArgs(InputLanguage, Byte) InputLanguageChangedEventArgs(InputLanguage, Byte) InputLanguageChangedEventArgs(InputLanguage, Byte) InputLanguageChangedEventArgs(InputLanguage, Byte)

用指定的输入语言和字符集初始化 InputLanguageChangedEventArgs 类的新实例。Initializes a new instance of the InputLanguageChangedEventArgs class with the specified input language and character set.

属性

CharSet CharSet CharSet CharSet

获取与新输入语言关联的字符集。Gets the character set associated with the new input language.

Culture Culture Culture Culture

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

InputLanguage InputLanguage InputLanguage InputLanguage

获取指示输入语言的值。Gets a value indicating the 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)

适用于

另请参阅