Control.ImeModeChanged 이벤트

정의

ImeMode 속성이 변경되면 발생합니다.

public:
 event EventHandler ^ ImeModeChanged;
public event EventHandler ImeModeChanged;
member this.ImeModeChanged : EventHandler 
Public Custom Event ImeModeChanged As EventHandler 

이벤트 유형

예제

다음 코드 예제는 속성 값이 변경될 때 Text 실행되는 이벤트 처리기입니다. Control 클래스에는 해당 PropertyName 값이 변경될 때 발생하는 이름 패턴 PropertyNameChanged이 있는 여러 메서드가 있습니다(PropertyName은 해당 속성의 이름을 나타남).

다음 코드 예제에서는 표시되는 통화 데이터의 를 TextBox 변경 ForeColor 합니다. 이 예제에서는 텍스트를 10진수로 변환하고 이 음수이 Color.Black 면 를 로, 숫자가 양수이면 으로 변경 ForeColorColor.Red 합니다. 이 예제에서는 를 Form 포함하는 가 있어야 합니다 TextBox.

private:
   void currencyTextBox_TextChanged( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      try
      {
         // Convert the text to a Double and determine if it is a negative number.
         if ( Double::Parse( currencyTextBox->Text ) < 0 )
         {
            // If the number is negative, display it in Red.
            currencyTextBox->ForeColor = Color::Red;
         }
         else
         {
            // If the number is not negative, display it in Black.
            currencyTextBox->ForeColor = Color::Black;
         }
      }
      catch ( Exception^ ) 
      {
         // If there is an error, display the text using the system colors.
         currencyTextBox->ForeColor = SystemColors::ControlText;
      }
   }
private void currencyTextBox_TextChanged(object sender, EventArgs e)
{
   try
   {
      // Convert the text to a Double and determine if it is a negative number.
      if(double.Parse(currencyTextBox.Text) < 0)
      {
         // If the number is negative, display it in Red.
         currencyTextBox.ForeColor = Color.Red;
      }
      else
      {
         // If the number is not negative, display it in Black.
         currencyTextBox.ForeColor = Color.Black;
      }
   }
   catch
   {
      // If there is an error, display the text using the system colors.
      currencyTextBox.ForeColor = SystemColors.ControlText;
   }
}
Private Sub currencyTextBox_TextChanged(sender As Object, _ 
  e As EventArgs) Handles currencyTextBox.TextChanged
   Try
      ' Convert the text to a Double and determine if it is a negative number.
      If Double.Parse(currencyTextBox.Text) < 0 Then
         ' If the number is negative, display it in Red.
         currencyTextBox.ForeColor = Color.Red
      Else
         ' If the number is not negative, display it in Black.
         currencyTextBox.ForeColor = Color.Black
      End If
   Catch
      ' If there is an error, display the text using the system colors.
      currencyTextBox.ForeColor = SystemColors.ControlText
   End Try
End Sub

설명

이 이벤트는 프로그래매틱 수정 또는 상호 작용을 통해 속성이 변경된 경우에 ImeMode 발생합니다.

입력 메서드 관리자를 지원하지 않는 컨트롤은 이 이벤트를 발생시키지 않습니다.

이벤트 처리에 대한 자세한 내용은 이벤트 처리 및 발생 을 참조하십시오.

적용 대상

추가 정보