本文介绍了TextBox子类中的预定义命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ComponentCommands.MoveFocusUp具有默认的按键手势(Ctrl + Up),我想在派生自TextBox的自定义类中使用它.
我将TextBox子类化,并添加了以下命令绑定:

ComponentCommands.MoveFocusUp has a default key gesture (Ctrl+Up) I''d like to use in a custom class derived from TextBox.
I''ve subclassed TextBox, added following command bindings:

this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy, CopyCommandHandler)); // Ctrl+C
this.CommandBindings.Add(new CommandBinding(ComponentCommands.MoveFocusUp, MoveCurrentLineUpCommandHandler)); // Ctrl+Up


到默认的构造函数,也定义了处理程序.但是,只有CopyCommandHandler响应键盘交互.有任何建议吗?


to the default constructor, and defined handlers too. But only CopyCommandHandler responds to keyboard interaction. Any suggestions?

推荐答案


这篇关于TextBox子类中的预定义命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 05:57