InputLanguageChangedEventArgs Clase

Definición

Proporciona datos para el evento 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
Herencia
InputLanguageChangedEventArgs

Ejemplos

En el ejemplo siguiente se crea Form un nuevo y se adjunta un controlador de eventos al evento.InputLanguageChangedThe following example creates a new Form and attaches an event handler to the InputLanguageChanged event. Este evento cambia IMEmode cuando el idioma de entrada cambia a japonés.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

Comentarios

Puede usar los datos de InputLanguageChangedEventArgs para tomar decisiones sobre si desea cambiar los editores de métodos de entrada (IME) o intercambiar los valores de derecha a izquierda.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. También puede cambiar el CurrentCulture de un subproceso y las CurrentUICulture propiedades para que se recojan los distintos recursos.You can also change the CurrentCulture of a thread and the CurrentUICulture properties so that different resources get picked up.

InputLanguageChangedEventArgs Identifica la configuración regional y el juego de caracteres del nuevo idioma de entrada.An InputLanguageChangedEventArgs identifies the locale and the character set of the new input language.

El InputLanguageChanging evento precede al InputLanguageChanged evento.The InputLanguageChanging event precedes the InputLanguageChanged event.

Constructores

InputLanguageChangedEventArgs(CultureInfo, Byte)

Inicializa una nueva instancia de la clase InputLanguageChangedEventArgs con la configuración regional y el juego de caracteres especificados.Initializes a new instance of the InputLanguageChangedEventArgs class with the specified locale and character set.

InputLanguageChangedEventArgs(InputLanguage, Byte)

Inicializa una nueva instancia de la clase InputLanguageChangedEventArgs con el idioma de entrada y el juego de caracteres especificados.Initializes a new instance of the InputLanguageChangedEventArgs class with the specified input language and character set.

Propiedades

CharSet

Obtiene el juego de caracteres asociado al nuevo idioma de entrada.Gets the character set associated with the new input language.

Culture

Obtiene la configuración regional del idioma de entrada.Gets the locale of the input language.

InputLanguage

Obtiene un valor que indica el idioma de entrada.Gets a value indicating the input language.

Métodos

Equals(Object)

Determina si el objeto especificado es igual al objeto actual.Determines whether the specified object is equal to the current object.

(Heredado de Object)
GetHashCode()

Sirve como la función hash predeterminada.Serves as the default hash function.

(Heredado de Object)
GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Heredado de Object)
MemberwiseClone()

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

(Heredado de Object)
ToString()

Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object.

(Heredado de Object)

Se aplica a

Consulte también: