Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1360
Hide Ribbon Context menu
posted

Is there a way to hide the contextmenu on a ribbon?

I've tried this with a creation filter, but I can only remove the child elements, but not the parent ToolbarListMenuControlUIElement, so an empty "context menu" is still shown

 

        #region IUIElementCreationFilter Members

        public void AfterCreateChildElements(UIElement parent)
        {
            if (parent is ToolbarListMenuControlUIElement)
            {
                parent.ChildElements.Clear();
            }
        }

        public bool BeforeCreateChildElements(UIElement parent)
        {
            return false;
        }

        #endregion