Context Menu in Windows Forms Diagram

Built-in context menu

The Essential Diagram of Windows Forms provides built-in context menu support to the Diagram.

All available tools for the Diagram control such as File options, Edit options, Action options, Layout, Connectors, and Shapes are listed in the built-in context menu.

Use Case Scenarios

This feature enables easy access of frequently used options.

Properties_

Property Description Type Data Type Reference links

DefaultContextMenuEnabled

Used to enable default context menu. NA Boolean NA

Enabling Default Context Menu

You can enable the default context menu using the DefaultContextMenuEnabled property.

The following code illustrates how to enable the default context menu:

//show default context menu
diagram1.DefaultContextMenuEnabled = true;
'show default context menu
diagram1.DefaultContextMenuEnabled = True

Diagram Context-Menu

The following code illustrates how to disable the default context menu:

//hide default context menu
diagram1.DefaultContextMenuEnabled = false;
'hide default context menu
diagram1.DefaultContextMenuEnabled = False

Sample Link

To view a sample:

  1. Open the Syncfusion Dashboard.
  2. Click the Windows Forms drop-down list and select Run Locally Installed Samples.
  3. Navigate to Diagram Samples > Product Showcase > Diagram Builder.