WPF tab order with custom controls?

前端 未结 5 1244
别那么骄傲
别那么骄傲 2021-01-14 13:46

I have a WPF page that contains several out of the box controls with the tab order set.

I have a custom control (NumericSpinner) that contains: border/grid/text box/

5条回答
  •  猫巷女王i
    2021-01-14 14:11

    I've tried using the selected answer's GotFocus event, but it doesn't work for me, it seems to disable the tab navigation altogether, even though the first TabStop is indeed selected.
    What worked for me was using the WindowActivated event and use the same command there:

    MoveFocus(new TraversalRequest(FocusNavigationDirection.First));
    

    I hope it might help someone.

提交回复
热议问题