且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从 Excel 调用的 WPF 窗口,上下文菜单立即显示和消失

更新时间:2023-11-30 21:37:04

我有一个使用 WPF 的 Excel 加载项显示您描述的行为.就我而言,这是此框架错误的连续错误:

I had an Excel-Add-In using WPF showing the behavior you describe. In my case it was a consecutive error of this framework bug:

https://connect.microsoft.com/VisualStudio/feedback/details/432998/excel-2007-vsto-custom-task-pane-with-wpf-context-menu-has-focus-问题

推荐的解决方法之一对我有用:

One of the recommended workarounds worked for me:

http://blogs.msdn.com/b/vsod/archive/2009/12/16/excel-2007-wpf-events-are-not-fired-for-items-that-overlap-excel-ui-for-wpf-context-menus.aspx