I there a way to know which item has the focus in and WPF application?
Is there a way to monitor all events and methods calls in wpf?
I there a way to know which item has the focus in and WPF
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ok on this page you’ll find a solution but it’s a bit nasty if you ask me:
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a420dc50-b238-4d2e-9209-dfbd98c7a060
It uses the VisualTreeHelper to create a big list of all the controls out there and then asks them is they have the focus by lookin at the IsFocused property.
I would think that there is a better way to do it.
Perhaps do a search for Active control or Focussed control in combination with WPF.
EDIT:
This topic might be useful
How to programmatically navigate WPF UI element tab stops?