InputLanguageChangedEventHandler Delegate
.NET Framework (current version)
Represents the method that will handle the InputLanguageChanged event of a Form.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
public delegate void InputLanguageChangedEventHandler( Object^ sender, InputLanguageChangedEventArgs^ e )
Parameters
- sender
-
Type:
System::Object^
The source of the event.
- e
-
Type:
System.Windows.Forms::InputLanguageChangedEventArgs^
An InputLanguageChangedEventArgs that contains the event data.
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.
The following example creates a new Form and attaches an event handler to the InputLanguageChanged event. 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 ); }
.NET Framework
Available since 1.1
Available since 1.1
Show: