Information générale
Catégorie:
Windows Presentation Foundation (WPF)
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement