web浏览器快捷方式在PowerPoint中不工作的附加......但WebBrowserShortcutsEnabled是真实的 [英] WebBrowser shortcuts not working in PowerPoint add-in... but WebBrowserShortcutsEnabled is true

查看:395
本文介绍了web浏览器快捷方式在PowerPoint中不工作的附加......但WebBrowserShortcutsEnabled是真实的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要建一个PowerPoint加载项是要根据各地的嵌入式浏览器去。出于某种原因,不过,标准的快捷方式不起作用。该WebBrowserShortcutsEnabled属性设置为true(虽然我甚至得到尽可能努力的情况下,将其设置为false,我是世界上倒退)。剥离下来的光秃秃的骨头,我的摄制步骤是:

I'm building a powerpoint add-in that is going to be based around an embedded browser. For some reason, though, the standard shortcuts don't work. The WebBrowserShortcutsEnabled property is set to true (though I even got as far as trying setting it to false in case I was in backwards world). Stripping it down to the bare bones, my repro steps are:


  • 创建一个新的项目,选择的PowerPoint 2013加载项目类型

  • 添加新的用户控件到项目

  • 一个web浏览器添加到控制,从工具箱

  • 拖动
  • 设置的URL上web浏览器来如谷歌在属性面板

  • 此代码添加到ThisAddIn_Startup方法,使显示器立即:

  • Create a new project, selecting the PowerPoint 2013 Add-in project type
  • Add a new User Control to the project
  • Add a WebBrowser to that control, dragging it from the Toolbox
  • Set the URL on that WebBrowser to e.g. google in the properties panel
  • Add this code to the ThisAddIn_Startup method, so the panel displays immediately:

private void ThisAddIn_Startup(object sender, System.EventArgs e) {
    var ctrl = new UserControl1();
    var ctp = this.CustomTaskPanes.Add(ctrl, "test");
    ctp.Visible = true;
}

在web浏览器

打字里面PowerPoint中工作正常,但按Ctrl + X / C / V,德尔,标签等,都没有效果。

Typing in the WebBrowser inside PowerPoint works fine, but Ctrl+X/C/V, Del, Tab etc. all have no effect.

我试过重写方法的OnKeyPress在网络上浏览器,以及添加PreviewKeyDownEventHandler,但断点均从未那些方法被击中。我也验证了WebBrowserShortcutsEnabled仍然在运行时真正的,并没有以某种方式被改变了。

I've tried overriding the OnKeyPress method on the web browser, as well as adding a PreviewKeyDownEventHandler, but breakpoints in both of those methods never got hit. I've also verified that WebBrowserShortcutsEnabled is still true at run-time and hasn't somehow been changed.

我开始怀疑,这可能是一个环境问题,但我无所适从,以什么可能的根本原因。我运行的是Windows 8.1,VS 2012和PowerPoint 2013,目标.NET 4.5。我也试过同样的结果在Windows 7上PowerPoint 2010中安装了相同的基本插件。

I'm beginning to suspect that it might be an environment issue, but I'm at a loss as to what might the root cause. I'm running Windows 8.1, VS 2012 and PowerPoint 2013, targeting .NET 4.5. I also tried installing the same basic plugin on PowerPoint 2010 on Windows 7 with the same result.

有没有人有任何深入了解什么可能是错误去为我?

Has anyone got any insight into what might be going wrong for me?

感谢

推荐答案

这样看来,把Web浏览器在Windows内表,并显示它作为一个模式窗口,而不是使用自定义任务窗格,使快捷方式正常工作。

It would appear that putting the Web Browser inside a Windows Form, and displaying it as a modal window, rather than using a Custom Task Pane makes the shortcuts work as expected.

这篇关于web浏览器快捷方式在PowerPoint中不工作的附加......但WebBrowserShortcutsEnabled是真实的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆