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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to remove dock context menu for a particular WinForms Docking Manager control?

Platform: WinForms |
Control: DockingManager

Context menu event

The WinForms 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.


// EventHandler for DockContextMenu
private void dockingManager1_DockContextMenu(object
sender,Syncfusion.Windows.Forms.Tools.DockContextMenuEventArgs arg)
       arg.ContextMenu=new Syncfusion.Windows.Forms.Tools.XPMenus.PopupMenu();



' 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 Syncfusion.Windows.Forms.Tools.XPMenus.PopupMenu()
End Sub


UG document link: https://help.syncfusion.com/windowsforms/dockingmanager/docking-events#dockcontextmenu-event

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.

Up arrow icon

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

Live Chat Icon For mobile