gpt4 book ai didi

c# - 当托管在 VSTO/Outlook 加载项中的 ElementHost 中时,WPF 文本框不允许撤消

转载 作者:可可西里 更新时间:2023-11-01 03:02:29 25 4
gpt4 key购买 nike

我有一个 Outlook 插件 (VSTO),在 Outlook 窗体区域我有一个 ElementHost 中的 WPF 用户控件。我有一个问题,我的用户控件中的文本框没有撤消功能......在某些配置中。特别是在 Windows 7/Outlook 2007 中,撤消(即 Ctrl-Z)不起作用,即使剪切/复制等都可以。有趣的是,Windows 8/Outlook 2010 撤消确实有效。

TextBox XAML 是:

<TextBox 
Name="txtnote"
VerticalScrollBarVisibility="Auto"
SpellCheck.IsEnabled="True"
Text="Topic notes..."
TextWrapping="Wrap"
AcceptsReturn="True" />

注意:我已尝试设置以下属性以使其工作但无济于事:IsUndoEnabled="True"UndoLimit="-1"

谁能告诉我为什么会这样,我可以做些什么来让它按预期工作?

2014 年 1 月 7 日更新。我已将以下 KeyBindings 添加到文本框:

<TextBox.InputBindings>
<KeyBinding Command="ApplicationCommands.Undo" Key="Z" Modifiers="Control" />
<KeyBinding Command="ApplicationCommands.Redo" Key="Y" Modifiers="Control" />
<KeyBinding Command="ApplicationCommands.Undo" Key="G" Modifiers="Alt" />
</TextBox.InputBindings>

结果是 - Cntl-Z/Cntrl-Y 仍然无效,但是 Alt-G 有效!

最佳答案

不允许插件处理核心 Excel 快捷方式。可能正因为如此,快捷方式不起作用。

关于c# - 当托管在 VSTO/Outlook 加载项中的 ElementHost 中时,WPF 文本框不允许撤消,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20657350/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com