How to set focus to UserControl (make it selectable)?

后端 未结 1 1669
梦毁少年i
梦毁少年i 2021-01-12 10:21

I need to set focus to UserControl itself, not its child.
Otherwise I cannot implement insertion from the buffer. :(
Setting Focusable=True

相关标签:
1条回答
  • The whole problem was in my misunderstanding of controls' behavior.
    This SO question clearly shows it I believe.

    Thus, setting UserControl.Focusable = true is not sufficient. To make it navigatable via keyboard IsTabStop must be true also. And to make UC selectable by mouse click we should call Focus() in mouse eventhandler. That's it.

    0 讨论(0)
提交回复
热议问题