I need to hide the context menu of Ribbon Control
I tried
<Ribbon.ContextMenu><ContextMenu Visibility="Hidden"></ContextMenu></Ribbon.ContextMenu>
This did the job upto some extent. ie it disables context menu when right clicked on empty space. But when i right click on a ribbon button, still the context menu appears. How can i disable this?
Ribbon is a ribbon, you should not disable its features. If your "ribbon" really looks like this, consider using toolbars.
That being said, you can disable context menus by setting them to null on all controls on all levels of hierarchy:
<Ribbon ContextMenu="{x:Null}">
<RibbonTab Header="abc" ContextMenu="{x:Null}">
<RibbonGroup Header="abc" ContextMenu="{x:Null}">
<RibbonButton Content="abc" ContextMenu="{x:Null}"/>
</RibbonGroup>
</RibbonTab>
</Ribbon>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With