Keyboard won't dismiss even after Focus change

后端 未结 5 1909
忘掉有多难
忘掉有多难 2020-12-19 06:05

I am creating a Windows 8.1 app and after the user presses a button, a popup opens over most of the screen. There are several textboxes inside the popover.

I found

5条回答
  •  佛祖请我去吃肉
    2020-12-19 06:34

    When the textbox that shows the virtual keyboard was disabled it will dismiss the virtual keyboard. so the solution is set the textbox property IsEnabled to false and set it again to true so it can be use again.

    TextBox.KeyDown += (s, a) => {
     if (a.Key == VirtualKey.Enter) {
       TextBox.IsEnabled = false;
       TextBox.IsEnabled = true;
     }
    

提交回复
热议问题