How to create a right-click context menu for a button in WPF?

Total Post:22

Points:154

WPF 
WPF
 2540  View(s)
Ratings:
Rate this:

How to create a right-click context menu for a button in WPF?

i know how to create a left-click context menu for a button, but I am not too sure how to do it for a right click? (i.e. how to specify that the context menu should appear on a right-click, not a left click).

Thanks in advanced!

  1. Re: How to create a right-click context menu for a button in WPF?

    here is a sample..

    <Button Content="button" Name="btn" Width="100">
                <Button.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="Cut"/>
                        <MenuItem Header="Copy"/>
                        <MenuItem Header="Paste"/>
                    </ContextMenu>
                </Button.ContextMenu>
            </Button>

      Modified On Mar-30-2018 05:52:44 AM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.