Instable focus of WPF apps

后端 未结 2 2025
长发绾君心
长发绾君心 2021-01-15 10:15

If I have problems with WPF, then it always concerns the Focus-Management. There are cases, my App loses totally focus so that another application gains the focus an

2条回答
  •  广开言路
    2021-01-15 11:14

    For losing focus for the entire app make sure you set the Owner property on all windows before you show them.

    For losing focus inside the app, usually this happens when some control you didn't think off is getting but not showing anything (for example some random StackPanel or Grid used for layout), you have to hunt those down and add Focusable="false"

提交回复
热议问题