简体   繁体   中英

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..

If i press any thing but Space all 3 events are triggered, but if i press space only the OnTextChanged is triggered? so why doesn't space count as a key or textinput?

您必须处理PreviewKeyDown事件,因为默认情况下处理空间并因此框架使用该空间。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM