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 remove DockContextMenu for a particular control?

Platform: WinForms |
Control: DockingManager |
Published Date: April 30, 2011 |
Last Revised Date: July 10, 2014


The DockingManager has an event called DockContextMenu.This event will get fired before showing the menu.We could remove menu by handling this event.

The event handler has an argument of type DockContextMenuEventArgs.That arguement has 2 properties ContextMenu of type PopupMenu and Owner of type control.ContextMenu gives access to the menu which is going to be displayed and Owner identifies the docked control.So by checking this Owner object we can remove the contextmenu for a particular control.

Please refer the below code snippet


// EventHandler for DockContextMenu

private void dockingManager1_DockContextMenu(object

sender,Syncfusion.Windows.Forms.Tools.DockContextMenuEventArgs arg){

if(arg.Owner==calculatorControl1) arg.ContextMenu=new




' EventHandler for DockContextMenu

Private Sub dockingManager1_DockContextMenu(ByVal sender As Object, ByVal arg As Syncfusion.Windows.Forms.Tools.DockContextMenuEventArgs)

Handles dockingManager1.DockContextMenu

If arg.Owner Is calculatorControl1 Then arg.ContextMenu = New


End Sub

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the 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