두 개의 textBox가있는 WPF의 작은 애플리케이션이 있습니다. 그들 중 한 명이 초점을 맞출 때 터치 키보드를 보여줘야합니다. correclty 다음 코드를 사용하여 작동한다 :C에서 텍스트 상자의 포커스가 사라지면 터치 키보드가 자동으로 숨김
Process theTouchKeyboardProcess = null;
...
private void textBoxA_GotFocus(object sender, RoutedEventArgs e)
{
theTouchKeyboardProcess = Process.Start(@"C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe");
}
문제는 내가 다른 텍스트 상자가 포커스를 얻었을 때 터치 키보드를 숨길 것입니다. 나는 이것을 시도했다 :
private void textBoxA_LostFocus(object sender, RoutedEventArgs e)
{
try
{
theTouchKeyboardProcess.Kill();
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
그러나 그것은 예외를 시작한다.
질문은이 수정 작업을 수행하는 가장 좋은 방법은 무엇입니까?
감사합니다.
어떤 예외가 발생합니까? – opewix