---
title: "How to create a right-click context menu for a button in WPF?"  
description: "How to create a right-click context menu for a button in WPF?"  
author: "Madam Walker"  
published: 2013-08-10  
updated: 2013-08-10  
canonical: https://www.mindstick.com/forum/1372/how-to-create-a-right-click-context-menu-for-a-button-in-wpf  
category: "wpf"  
tags: ["wpf"]  
reading_time: 1 minute  

---

# How to create a right-click context menu for a button in WPF?

How to create a [right](https://www.mindstick.com/articles/12766/check-whether-you-are-doing-digital-transformation-right-or-not)-[click](https://www.mindstick.com/articles/12423/social-login-magento-2-one-click-to-register-social) [context](https://www.mindstick.com/forum/23245/what-is-context-in-android) menu for a [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) in [WPF](https://www.mindstick.com/forum/304/wpf)?

i know how to create a [left](https://www.mindstick.com/articles/12768/don-t-be-left-behind-with-the-new-it-revolution)-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](https://www.mindstick.com/articles/12993/5-advanced-features-for-your-odoo-ecommerce-theme)!

## Replies

### Reply by Pravesh Singh

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>
```


---

Original Source: https://www.mindstick.com/forum/1372/how-to-create-a-right-click-context-menu-for-a-button-in-wpf

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
