Cursor Focus on Textbox in WPF/C#

前端 未结 8 1041
星月不相逢
星月不相逢 2020-12-23 22:14

I am currently in the process of creating a Onscreen keyboard. I am handling the button click using routedcommands. The issue is that when i click on the button in keyboard

8条回答
  •  鱼传尺愫
    2020-12-23 22:58

    To set logical focus to an input control

    FocusManager.SetFocusedElement(this, textboxJack);     // set logical focus
    

    To set keyboard focus to an input control

    Keyboard.Focus(textboxJill);                             // set keyboard focus
    

    To know the difference between logical and keyboard focus

    Input Overview - Focus on MSDN

提交回复
热议问题