영어로 읽기

다음을 통해 공유


Control.ImeModeChanged 이벤트

정의

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

public event EventHandler ImeModeChanged;

이벤트 유형

예제

다음 코드 예제는 속성 값이 변경될 때 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
   {
      // If there is an error, display the text using the system colors.
      currencyTextBox.ForeColor = SystemColors.ControlText;
   }
}

설명

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

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

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

적용 대상

제품 버전
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

추가 정보