[英]WPF TextBox inheritance KeyDown does not trigger on space?
I have a class that inherits the wpf textbox and i have overridden the OnTextChanged, OnTextInput, OnKeyDown now to the funny part.. 我有一个继承wpf文本框的类,我已经将OnTextChanged,OnTextInput,OnKeyDown重写为有趣的部分..
If i press any thing but Space all 3 events are triggered, but if i press space only the OnTextChanged is triggered? 如果我按任何东西但是Space会触发所有3个事件,但是如果我按空格只触发OnTextChanged? so why doesn't space count as a key or textinput?
那么为什么空间不算作关键或文本输入?
您必须处理PreviewKeyDown
事件,因为默认情况下处理空间并因此框架使用该空间。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.