0
votes

It seems you can set the focus of a focusscope with FocusManager.SetFocusedElement(Dependency object, IInputElement) but I was wondering how much of this is automated by wpf. If I click another control inside the same window, will the focus automatically be changed or do I need to manually do hit testing and then set the focused element?

2

2 Answers

1
votes

If you use standard controls like Button or TextBox the Focus is set automatically. If you're inventing your own controls (and don't do so by building them with the standard controls) you might have to implement the focus yourself.

1
votes

Yes. The focus is automatically set to the respective controls. Because these all taken care by the Windows operating system.