I have my own TreeView control in a panel in my application. When you click on items, they get keyboard focus.
You can select a set of elements in the tree and cut or delete them by pressing Ctrl-X or Delete. When the elements of the tree are deleted, the keyboard focus returns to the main window.
This leads to trouble - if I cancel my crop, I will return my elements, but the keyboard focus is no longer on my panel, so I can’t (for example) go cut-cancel-cut-cancel.
What determines when the keyboard focus moves when an item is deleted? I quickly tried to make my panel IsFocusScope = "True", but this did not show any effect, and Focus Review does not mention how to control focus when deleting an element.
source
share