Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the equivalent of SetFocus()
Message
De
10/02/2009 12:10:52
 
 
À
10/02/2009 11:16:45
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Divers
Thread ID:
01380470
Message ID:
01380588
Vues:
53
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform