Home Dashboard Directory Help
Search

Excel 2007 VSTO Custom Task Pane with WPF Context Menu has focus problems by Robert Bigelow


Status: 

Active


13
0
Sign in
to vote
Type: Bug
ID: 432998
Opened: 4/16/2009 11:27:43 AM
Access Restriction: Public
3
Workaround(s)
view
13
User(s) can reproduce this bug

Description

When a WPF control with a context menu is hosted in a VSTO Custom Task Pane inside of Excel 2007 the context menu has focus problems. If the context menu extends past the bounds of the Custom Task Pane and the user clicks on it, the context menu does not receive the click and focus is shifted to whatever is behind the context menu item.

Additionally, the context menu will not open again once this happens, unless the user registers a right-click in Excel.
Details
Sign in to post a comment.
Posted by SliverNinja on 5/30/2011 at 12:21 AM
This issue also exists for Outlook if you use a WPF combobox with a long set of list items. If the combobox items go past the border of the application window, you lose focus to the application behind the active window when clicking a combobox selection.

Unsure at this point if you can alter the wpf style to get around this.
Posted by RCRacer on 3/24/2010 at 10:41 AM
This is not just Excel 2007 or WPF, this is affecting me with Word 2007 and Windows Forms controls inside a custom task pane.
On my Custom Task Pane I have a Windows Forms ComboBox control and when 'dropped down' if I select an item that is showing outside the custom task pane, either on the document or outside the entire application itself, my selection is ignored.
Posted by GaryGJohnson on 10/26/2009 at 11:39 AM
I'm experiencing this as well. Unfortunately it also occurs with any WPF component that extends beyond the boundaries of the window in any Office application -- an example of this being the pop-up window of a ComboBox.
Posted by Microsoft on 7/7/2009 at 12:02 PM
Thank you for reporting this issue. Though this issue is under investigation, we will likely not have a fix available in .NET 4.0. We will update this bug again when we are able to fix the issue in a future release. Thanks!
Posted by Microsoft on 4/19/2009 at 11:38 PM
Thanks for reporting this issue. We are escalating this bug to the product unit who works on that specific feature area. The team will review this issue and make a decision on whether they will fix it or not for the next release.

Thank you,
Visual Studio Product Team
Sign in to post a workaround.
Posted by Aleh Yafimau on 10/11/2011 at 4:13 AM
Please consider using this workaround. It perfectly works for Office 2007/2010.
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
Posted by chessfan on 7/21/2010 at 8:28 AM
You can also handle the keyboard event; this will fire correctly even if the box displays outside the bounds of the pane.
Posted by GaryGJohnson on 10/26/2009 at 11:42 AM
Controls that extend beyond the boundary of the Office window can either be modified so that they attempt to position themselves within the window boundaries, or they can be hosted in a Popup (http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.popup(VS.85).aspx).