开发者

WPF FocusManager interferring with focus

I have a grid, and in the grid I am setting my first element to be focused:

<Grid FocusManager.FocusedElement="{Binding ElementName=companyNameField}">

When the window opens, the correct control is focused.

But if I tab through the whole form, when the above focused field, should have the focus, there is no cursor evident anywhere on the window.

If I hit tab once more, it selects the control after the control that should be selected.

If I completely remove the focumanager attributes from my grid, I am correctly tabbing trough all my controls in the correct order.

Even stranger, if i leave in the focusmanager attributes and first click on the first text box and then focus through the entire form, then it selects my text box like an开发者_如何学编程y other control.

If you have any Ideas, I would love some help.

Thanks


I have had this happen to me, when I had some focus code in the code-behind fighting with the FocusManager. Mine was hidden in the Load of a nested UserControl, so I didn't notice it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜