Posted by a ceTe Software moderator
Hi,
You can achieve your requirement by suppressing the default contextmenu and setting your own custom context menu.
You can suppress default context menu in ContextMenuShowing event and add a custom one. You will need create a new context menu by adding items to it and set respective actions in item click event.
Here is a code sample
Code sample to trigger an event.
pdfViewer1.ContextMenuShowing+=new ContextMenuShowingEventHandler(pdfViewer1_ContextMenuShowing);
Event handler code sample to hide default and add new context menu.
void pdfViewer1_ContextMenuShowing(object sender, ContextMenuShowingEventArgs e)
{
e.Cancel = true;
ContextMenuStrip newMenu = new ContextMenuStrip();
e.AssignedContextMenu = newMenu;
ToolStripItem item3 = newMenu.Items.Add("Print");
item3.Click += new EventHandler(item3_Click);
}
Event handler for item click event.
void item3_Click(object sender, EventArgs e)
{
MessageBox.Show("Add printing action in this event");
//pdfViewer1.Print();
}
Thanks,
ceTe Software Support Team