We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to capture the Copy Event or How to modify default pop-up menu to capture the Copy Event?

Thread ID:





119823 Aug 5,2015 08:27 AM UTC Aug 6,2015 12:39 PM UTC WinForms 1
Tags: Diagram
Won K. Ham
Asked On August 5, 2015 08:27 AM UTC

Dear. Fellows.

Hello. This is Won.

I have encountered regarding a problem with 'Copy' and 'Paste' events in a Diagram control. Actually, I need to capture Copy event to recognize selected objects for copying. But I cannot find any handle to capture it. At least, I tried to modify Pop-up menu (Operated by Mouse R click) and capture a mouse click event when a user clicks 'Copy' button in a pop-up menu. But both are not accomplished. I could not find any passage to get the Copy Event or Pop-up menu event.

I do not have enough experience as a Syncfusion user (about few weeks). I think there is a way that I did not find. I need you experts helps very much.

Thank you.

Swarnesh Krishna Kumar [Syncfusion]
Replied On August 6, 2015 12:39 PM UTC

Hi Won,
Thanks for using Syncfusion Products.
We suggest you to disable the DefaultContextMenu and create a desired context menu in order to achieve your requirement. We have attached a sample for your reference.
Here is the Code Snippet:
//To disable the DefaultContextMenu
this.diagram2.DefaultContextMenuEnabled = false;

//Creation of Context Menu
System.Windows.Forms.ContextMenu cvp = new System.Windows.Forms.ContextMenu();


//Event while clicking the context menu item

cvp.MenuItems[0].Click += Form1_Click;
diagram2.ContextMenu = cvp;

//Rendering the Mouse Click event

//Capturing the node

void Form1_Click(object sender, EventArgs e)



            IDataObject clipboardData = Clipboard.GetDataObject();

            ClipboardNodeCollection c = (ClipboardNodeCollection)clipboardData.GetData(typeof(ClipboardNodeCollection));

            NodeCollection nodes = c as NodeCollection;

            foreach (Node n in nodes)


                Sel_Node = n;

                Sel_Node.PinPoint = new Point(100, 100);



Here is the Sample:
Please let us know if any concerns.
Swarnesh K


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon