# Context Menu

**RadPdfViewer** has a default context menu - **PdfViewerContextMenu** which provides a quick way of performing a number of commands. However, you can replace this menu with a custom one by setting the **RadContextMenu** property of the **RadPdfViewer**.

#### New Context Menu

```C#
this.radPdfViewer1.RadContextMenu = this.radContextMenu1;

```

```VB.NET
Me.radPdfViewer1.RadContextMenu = Me.radContextMenu1

```

You can also use the **ShowMenu** method to show the context menu programmatically at a specified location.

#### Show Context Menu

```C#
private void buttonShowMenu_Click(object sender, EventArgs e)
{
    this.radPdfViewer1.PdfViewerElement.ShowMenu(new Point(100, 100));
}

```

```VB.NET
Private Sub buttonShowMenu_Click(sender As Object, e As EventArgs) Handles buttonShowMenu.Click
    Me.radPdfViewer1.PdfViewerElement.ShowMenu(New Point(100, 100))
End Sub

```

The context menu can change dynamically. For example, when the Text Selection mode is enabled, *Copy* and *Select All* items are displayed in the menu with a separator below them:

| FixedDocumentViewerMode.Pan                                                                                                                                                            | FixedDocumentViewerMode.TextSelection                                                                                                                                                            |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ![WinForms RadPdfViewer FixedDocumentViewerMode Pan](https://www.telerik.com/products/winforms/documentation/assets/7f46fcde2917eaff71325907c58c2a3e/pdfviewer-ui-context-menu001.png) | ![WinForms RadPdfViewer FixedDocumentViewerMode TextSelection](https://www.telerik.com/products/winforms/documentation/assets/8539ee5166ba3c95505a25fa6437e4fd/pdfviewer-ui-context-menu002.png) |

Additionally, you can easily add a custom menu item to the context menu. You can find below a sample code snippet:

#### Add New Menu Item

```C#
public PdfUI()
{
    InitializeComponent();

    RadMenuItem item = new RadMenuItem("MyItem");
    item.Click += item_Click;
    this.radPdfViewer1.PdfViewerElement.ContextMenu.Items.Add(item);
}

private void item_Click(object sender, EventArgs e)
{
    RadMessageBox.Show("Perform your custom action here");
}

```

```VB.NET
Public Sub New()
    InitializeComponent()

    Dim item As New RadMenuItem("MyItem")
    AddHandler item.Click, AddressOf item_Click
    Me.RadPdfViewer1.PdfViewerElement.ContextMenu.Items.Add(item)
End Sub

Private Sub item_Click(sender As Object, e As EventArgs)
    RadMessageBox.Show("Perform your custom action here")
End Sub
```

## See Also

* [Getting Started](https://www.telerik.com/products/winforms/documentation/controls/pdfviewer/getting-started)
* [Document Modes](https://www.telerik.com/products/winforms/documentation/controls/pdfviewer/ui/document-modes)
* [View Modes](https://www.telerik.com/products/winforms/documentation/controls/pdfviewer/ui/viewer-modes)
