방법: InputPanel 구성 요소 사용

업데이트: 2007년 11월

InputPanel 구성 요소를 사용하면 Pocket PC에서 SIP(Soft Input Panel)를 프로그래밍 방식으로 제어할 수 있습니다. SIP의 프로그래밍이 필요한 일반적인 경우는 SIP를 사용하거나 사용하지 않도록 설정할 때 폼에서 컨트롤의 위치를 변경하거나 컨트롤의 크기를 조정하는 경우입니다.

참고:

.NET Compact Framework 버전 1.0에서 InputPanel 구성 요소를 사용하려면 MainMenu 구성 요소가 필요합니다.

또한 Pocket PC에 설치된 모든 입력 방법에 대해 사용할 입력 방법을 지정할 수 있습니다. 방법을 설정하는 예제를 보려면 방법: Pocket PC 입력 방법 설정을 참조하십시오.

예제

다음 코드 예제에서는 SIP에 적합하게 TabControl의 크기를 조정하는 방법을 보여 줍니다.

폼에 다음과 같은 컨트롤이 포함되어 있습니다.

텍스트 상자가 포커스를 받으면 텍스트를 입력할 수 있도록 SIP가 활성화되고 사용자가 SIP를 사용하거나 사용하지 않도록 설정하면 EnabledChanged 이벤트가 발생합니다. 이 이벤트의 이벤트 처리기는 다음과 같은 작업을 수행합니다.

  • SIP를 사용하는 경우 SIP가 탭 컨트롤을 가리지 않도록 컨트롤의 높이가 줄어듭니다.

  • SIP를 사용하지 않는 경우 탭 컨트롤의 높이가 원래 높이로 설정됩니다. 이 값은 폼을 초기화했을 때 변수에 저장된 값입니다.

'Get the original height of the tab control.
TabOriginalHeight = TabControl1.Height

' Get the deminsions of the visible 
' desktop area when the SIP is not displayed.
VisibleRect = InputPanel1.VisibleDesktop
// Get the original height of the tab control.
TabOriginalHeight = tabControl1.Height;

// Get the deminsions of the visible 
// desktop area when the SIP is not displayed.
VisibleRect = inputPanel1.VisibleDesktop;


inputPanel1.EnabledChanged += new EventHandler(inputPanel1_EnabledChanged);

// Add a delegate for GotFocus event to the TextBox
// by creating an instance of EventHandler that takes
// a reference to TextBox1_GotFocus in its argument.
this.textBox1.GotFocus += new System.EventHandler(this.textBox1_GotFocus);

코드 컴파일

이러한 예제를 실행하려면 다음 네임스페이스에 대한 참조가 필요합니다.

참고 항목

작업

방법: Pocket PC 입력 방법 설정

개념

InputPanel 구성 요소

참조

InputPanel