WPF: OnKeyDown() not being called for space key in control derived from WPF TextBox

后端 未结 4 1783
谎友^
谎友^ 2020-12-06 00:39

In a WPF application, I have a control that I have derived from TextBox like this:

public class SelectableTextBlock : TextBox
{
    protected override void O         


        
4条回答
  •  南方客
    南方客 (楼主)
    2020-12-06 01:21

    I had this issue with spaces and events once in a textbox. Are the events NOT triggered only when you add or remove a space character?

    This is what I got as an answer: (http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/446ec083-04c8-43f2-89dc-1e2521a31f6b)

    Because some IMEs will treat whitespace keystroke as part of the text composition process, that's why it eats up by Avalon to report correct composited text through TextInput event.

    I could be completely out of the scope but reading this thread emmideatly made me think of that issue I once had.

    Kind regards, Wim

提交回复
热议问题