Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the equivalent of SetFocus()
Message
From
10/02/2009 12:10:52
 
 
To
10/02/2009 11:16:45
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Miscellaneous
Thread ID:
01380470
Message ID:
01380588
Views:
54
Hi Matt,

Have you checked the KeyboardNavigation.TabNavigation property? This property controls how navigation is handled in WPF containers.

Focus can fail for any of the following reasons:-

1] Element Enabled = false
2] Element IsVisible = false
3] Element Focusable = false

Or

4] Element is in a control and not the main xaml (not been loaded)
5] LostKeyboardFocus and PreviewLostKeyboardFocus are preventing it

Where you are trying to set the Focus in your code put a new line in that makes a call to the textbox PredictFocus method and set a breakpoint. PredictFocus will not shift the focus but it will tell you what should be focused next and help resolve containers that are not releasing the focus.

HTH
Neil
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform