Context menu is truncated in different .NET Framework. See images inside ZIP file (there are two screenshots, one from XP and other from Win7).
I created a simple Visual Studio 2010 solution which repro my issue.
( http://www.mediafire.com/download.php?doq7gsh75qgvzwq ).
On XP it seems to work fine, but not on Windows 7.
The issue can be reproduced on Windows 7 if target .NET Framework is 3.5 (including SP1) (please see the image from zip).
If I change the target framework to 4.0 it works fine also on Windows 7.
Is a solution to make context menu full visible in .NET Framework 3.5 on Windows 7 OS ?
It seems that when the
ContextMenuis loaded theScrollContentPresenterfor the menu isn’t sized correctly, clipping theItemPresenterof theMenuItems (Below is an abridged version of the visual tree showing the issue).Invalidating the measure of the of the
ContextMenu‘s visual root (thePopupRoot) when the menu is loaded should cause the layout to be updated to display the correct bounds for theItemsPresenter.The handler for the menu’s Load event:
GetVisualTreeRoot method: