Back to Devexpress

PdfPopupMenuShowingEventArgs.PopupMenuKind Property

windowsforms-devexpress-dot-xtrapdfviewer-dot-pdfpopupmenushowingeventargs.md

latest6.5 KB
Original Source

PdfPopupMenuShowingEventArgs.PopupMenuKind Property

Gets the type of a particular popup menu shown for the PDF Viewer.

Namespace : DevExpress.XtraPdfViewer

Assembly : DevExpress.XtraPdfViewer.v25.2.dll

NuGet Package : DevExpress.Win.PdfViewer

Declaration

csharp
public PdfPopupMenuKind PopupMenuKind { get; }
vb
Public ReadOnly Property PopupMenuKind As PdfPopupMenuKind

Property Value

TypeDescription
PdfPopupMenuKind

A PdfPopupMenuKind enumeration value which represents the kind of a popup menu shown for the PDF Viewer.

|

Available values:

NameDescriptionExample
PageContent

Specifies a popup menu that can be invoked by right clicking the page content of the PDF Viewer.

|

| | BookmarkTree |

Specifies a popup menu that can be invoked by right clicking the bookmark item in the bookmarks hierarchical tree on the Navigation pane of the PDF Viewer.

|

| | BookmarkOptions |

Specifies a popup menu that can be invoked by clicking the Options drop-down button in the Bookmarks panel of the PDF Viewer.

|

| | Thumbnail |

Specifies a popup menu that can be invoked by right clicking the page thumbnail on the Navigation pane of the PDF Viewer.

|

| | ThumbnailOptions |

Specifies a popup menu that can be invoked by clicking the Options drop-down button in the Page Thumbnails panel of the PDF Viewer.

|

| | CommentOptions |

A pop-up menu that appears when the user clicks Options on the Comments navigation pane.

|

| | CommentSort |

A pop-up menu that appears when the user clicks Sort on the Comments navigation pane.

|

| | CommentFilter |

A pop-up menu that appears when the user clicks Filter on the Comments navigation pane.

|

| | Comment |

A pop-up menu that appears when the user right-clicks an annotation on the Comments navigation pane.

|

| | CommentReview |

A pop-up menu that appears when the user right-clicks an annotation on the Comments navigation pane and selects Set Status.

|

|

Example

View Example

csharp
using DevExpress.XtraPdfViewer;
using DevExpress.XtraPdfViewer.Commands;
using DevExpress.XtraPdfViewer.Extensions;
//...

void pdfViewer1_PopupMenuShowing(object sender, PdfPopupMenuShowingEventArgs e)
{
    // Remove Rotate Clockwise and Rotate Counterclockwise items
    // from the Page Content popup menu.
    if (e.PopupMenuKind == PdfPopupMenuKind.PageContent)
    {
        var rotateClockwiseItem =
            e.ItemLinks.GetPdfViewerBarItemLink(PdfViewerCommandId.RotatePageClockwise);
        e.ItemLinks.Remove(rotateClockwiseItem);

        var rotateCounterclockwiseItem =
            e.ItemLinks.GetPdfViewerBarItemLink(PdfViewerCommandId.RotatePageCounterclockwise);
        e.ItemLinks.Remove(rotateCounterclockwiseItem);
    }
}
vb
Imports DevExpress.XtraPdfViewer
Imports DevExpress.XtraPdfViewer.Commands
Imports DevExpress.XtraPdfViewer.Extensions

Private Sub pdfViewer1_PopupMenuShowing(ByVal sender As Object, ByVal e As PdfPopupMenuShowingEventArgs)

    If e.PopupMenuKind = PdfPopupMenuKind.PageContent Then
        Dim rotateClockwiseItem = e.ItemLinks.GetPdfViewerBarItemLink(PdfViewerCommandId.RotatePageClockwise)
        e.ItemLinks.Remove(rotateClockwiseItem)

        Dim rotateCounterclockwiseItem = e.ItemLinks.GetPdfViewerBarItemLink(PdfViewerCommandId.RotatePageCounterclockwise)
        e.ItemLinks.Remove(rotateCounterclockwiseItem)
    End If
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the PopupMenuKind property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-pdf-viewer-manage-popup-menu-items/CS/RemoveItemsFromPopupMenu/Form1.cs#L31

csharp
// Hide the popup menu for the bookmark tree.
if (e.PopupMenuKind == PdfPopupMenuKind.BookmarkTree)
{

winforms-pdf-viewer-manage-popup-menu-items/VB/RemoveItemsFromPopupMenu/Form1.vb#L26

vb
' Hide the popup menu for the bookmark tree.
If e.PopupMenuKind = PdfPopupMenuKind.BookmarkTree Then
    e.ItemLinks.Clear()

See Also

PdfPopupMenuShowingEventArgs Class

PdfPopupMenuShowingEventArgs Members

DevExpress.XtraPdfViewer Namespace