Skip to main content
A newer version of this page is available. .

PdfPopupMenuShowingEventArgs.PopupMenuKind Property

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

Namespace: DevExpress.XtraPdfViewer

Assembly: DevExpress.XtraPdfViewer.v18.2.dll

Declaration

public PdfPopupMenuKind PopupMenuKind { get; }

Property Value

Type Description
PdfPopupMenuKind

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

Available values:

Name Description
PageContent

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

PageContent

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.

BookmarkTree

BookmarkOptions

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

BookmarkOptions

Thumbnail

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

ThumbnailPopup

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.

ThumbnailsOptionsPopup

Example

The PDF Viewer has several types of popup menus that can be invoked by an end-user for bookmark options, bookmark tree, page content, thumbnail and thumbnail options.

This example shows how to hide the popup menu for the bookmark tree and remove specific items from the page content popup menu.

To customize items of the PDF Viewer’s popup menu, handle the PdfViewer.PopupMenuShowing event. This event fires every time an end-user opens a popup menu in the PDF Viewer.

Each popup menu type has a unique set of bar items that are located in the bar item link collection. To access this collection, check the popup menu type using the PdfPopupMenuShowingEventArgs.PopupMenuKind property and use the PdfPopupMenuShowingEventArgs.ItemLinks property.

To hide a popup menu, clear all items from the bar item link collection.

To remove an item from a popup menu, find the item by the caption in the bar item link collection and then remove it.

using System.Windows.Forms;
using DevExpress.XtraPdfViewer;
using DevExpress.XtraBars;

namespace CustomPopupMenu {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
            pdfViewer1.LoadDocument("..\\..\\Demo.pdf");
        }

        void pdfViewer1_PopupMenuShowing(object sender, PdfPopupMenuShowingEventArgs e) {
            // Hide the popup menu for the bookmark tree.
            if (e.PopupMenuKind == PdfPopupMenuKind.BookmarkTree) {
                e.ItemLinks.Clear();
            }

            // Remove Rotate Clockwise and Rotate Counterclockwise items from the Page Content popup menu.
            if (e.PopupMenuKind == PdfPopupMenuKind.PageContent) {
                for (int i = e.ItemLinks.Count - 1; i >= 0; i--) {
                    BarItemLink link = e.ItemLinks[i];
                    if (link.Caption.Contains("Rotate"))
                        e.ItemLinks.Remove(link);
                }
            }
        }
    }
}

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.

See Also