Cursor Focus on Textbox in WPF/C#

前端 未结 8 1030
星月不相逢
星月不相逢 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:41

    Get the reference for the specific control(in that case TextBox). After click, in Button_Click method paste this:

    Dispatcher.BeginInvoke((ThreadStart)delegate
                {
                    control.Focus();
                });
    

提交回复
热议问题