InputLanguageChangedEventHandler InputLanguageChangedEventHandler InputLanguageChangedEventHandler InputLanguageChangedEventHandler Delegate


InputLanguageChangedForm イベントを処理するメソッドを表します。Represents the method that will handle the InputLanguageChanged event of a Form.

public delegate void InputLanguageChangedEventHandler(System::Object ^ sender, InputLanguageChangedEventArgs ^ e);
public delegate void InputLanguageChangedEventHandler(object sender, InputLanguageChangedEventArgs e);
type InputLanguageChangedEventHandler = delegate of obj * InputLanguageChangedEventArgs -> unit
Public Delegate Sub InputLanguageChangedEventHandler(sender As Object, e As InputLanguageChangedEventArgs)


Object Object Object Object

イベントのソース。The source of the event.


次の例では、 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
   RichTextBox^ rtb;

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

   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()
		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()
      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


InputLanguageChangedEventHandler デリゲートを作成する場合は、イベントを処理するメソッドを指定します。When you create an InputLanguageChangedEventHandler delegate, you identify the method that will handle the event. イベントをイベント ハンドラーに関連付けるには、デリゲートのインスタンスをイベントに追加します。To associate the event with your event handler, add an instance of the delegate to the event. デリゲートを削除しない限り、そのイベントが発生すると常にイベント ハンドラーが呼び出されます。The event handler is called whenever the event occurs, unless you remove the delegate.

イベントハンドラーデリゲートの詳細については、「イベントの処理と発生」を参照してください。For more information about event-handler delegates, see Handling and Raising Events.


GetMethodInfo(Delegate) GetMethodInfo(Delegate) GetMethodInfo(Delegate) GetMethodInfo(Delegate)

指定したデリゲートによって表されるメソッドを表すオブジェクトを取得します。Gets an object that represents the method represented by the specified delegate.