Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7669835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:41:06+00:00 2026-05-31T15:41:06+00:00

Context menu is truncated in different .NET Framework. See images inside ZIP file (there

  • 0

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 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:41:07+00:00Added an answer on May 31, 2026 at 3:41 pm

    It seems that when the ContextMenu is loaded the ScrollContentPresenter for the menu isn’t sized correctly, clipping the ItemPresenter of the MenuItems (Below is an abridged version of the visual tree showing the issue).

    PopupRoot, Acutal Width: 219,027, Desired Width: 219,027
        Decorator, Acutal Width: 219,027, Desired Width: 219,027
            NonLogicalAdornerDecorator, Acutal Width: 219,027, Desired Width: 219,027
                ContextMenuProxy, Acutal Width: 219,027, Desired Width: 219,027
                    SystemDropShadowChrome, Acutal Width: 214,027, Desired Width: 219,027
                        Border, Acutal Width: 214,027, Desired Width: 214,027
                            Grid, Acutal Width: 212,027, Desired Width: 212,027
                                Rectangle, Acutal Width: 28,000, Desired Width: 32,000
                                Rectangle, Acutal Width: 1,000, Desired Width: 31,000
                                Rectangle, Acutal Width: 1,000, Desired Width: 32,000
                                ScrollViewer, Acutal Width: 210,027, Desired Width: 212,027
                                    Grid, Acutal Width: 210,027, Desired Width: 210,027
                                        Border, Acutal Width: 210,027, Desired Width: 210,027
                                            ScrollContentPresenter, Acutal Width: 210,027, Desired Width: 210,027
                                                ItemsPresenter, Acutal Width: 241,047, Desired Width: 245,047
    

    Invalidating the measure of the of the ContextMenu‘s visual root (the PopupRoot) when the menu is loaded should cause the layout to be updated to display the correct bounds for the ItemsPresenter.

    The handler for the menu’s Load event:

    private void mainMenu_Loaded(object sender, RoutedEventArgs e)
    {
        if (sender != null)
        {
            ContextMenu menu = sender as ContextMenu;
            if (menu != null)
            {
               // get the visual root for the context menu
               var root = (FrameworkElement)GetVisualTreeRoot(menu);
    
               // invalidate the menu's layout
               root.InvalidateMeasure();
            }             
        }
    }
    

    GetVisualTreeRoot method:

    private DependencyObject GetVisualTreeRoot(DependencyObject control)
    {
        DependencyObject parent = VisualTreeHelper.GetParent(control);
        if (parent != null)
        {
            return GetVisualTreeRoot(parent);
        }
        else
        {
            return control;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can open a context menu but cannot see the opened menu list through
I have a context menu situated inside a User Control Resource. <UserControl.Resources> <ContextMenu x:Key=Menu1>
I have one general context menu and for example 4 buttons and 4 textboxes
Goal: Display different context menu if right clicking a row from the listview or
I have a context menu with a few items. One of the items has
I have created one context menu in Eclipse.I want to open an Editor after
Is it somehow possible to add a context menu item for one specific application
Aside from context menu -> Edit Top 200 Rows from Object Explorer, is there
I have a context menu and checkbox inside it, but checkbox displays not correctly.
how to show a context menu when you right click within a QGLWidget?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.