Perry
Perry

Reputation: 2292

Finding out which control has focus

Is there a way to figure out which control in my visualtree has focus? This is mostly for debugging.

Upvotes: 8

Views: 6946

Answers (1)

Like this

bool FocusedElement = FocusManager.GetFocusedElement() == textBox;

Use FocusManager

Upvotes: 23

Related Questions