SelectionChange用于输入和退格键

SelectionChange用于输入和退格键

本文介绍了SelectionChange用于输入和退格键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我们的VSTO插件需要知道当前的选择,以便我们可以将我们的任务窗格与当前选择同步。我们使用SelectionChanged事件来注册我们的任务窗口同步例程。问题是此事件不会在Enter或退格键上触发。
我们特别感兴趣的是Enter / backspace导致段落更改的情况(在段落中的最后一个字符的退格处输入和段落删除)。这对我来说似乎是一个错误,当删除键触发时,SelectionChange不会在退格键上触发


是否还有其他解决方法来检测此段落更改状态?

解决方案

Hello all,

Our VSTO addin needs to know the current selection so we can sync our taskpane with current selection. We are using the SelectionChanged event to register our taskpane synch routine. The problem is that this event doesn't fire on Enter or backspace key.We are specifically interested in the scenarios where the Enter/backspace results in a paragraph change(para add on enter and paragraph remove on backspace of the last character in a para). It seems like a bug to me that SelectionChange wont fire on backspace when the delete key does fires it.

Is there any other workaround to detect this paragraph change state?

解决方案


这篇关于SelectionChange用于输入和退格键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 20:02