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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to remove DockContextMenu for a particular control?

 

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

C#

// EventHandler for DockContextMenu

private void dockingManager1_DockContextMenu(object

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

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

Syncfusion.Windows.Forms.Tools.XPMenus.PopupMenu();

}

VB

' 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

Article ID: Published Date: Last Revised Date: Platform: Control:
1355 04/30/2011 07/10/2014 Windows Forms DockingManager
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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