ContextMenuStrip

The ContextMenuStrip control is used to provide a right click shortcut menu that can be associated with any control. For example, you can associate a shortcut menu with a control to provide functions not supported by standard ShortcutsEnabled property.

Properties

The key properties for the ContextMenuStrip control include:

  • Items. Specifies the menu items that are added to the ContextMenuStrip control.

  • RenderMode. Determines the visual style for displaying the ContextMenuStrip control.

Events

Events can be configured for the ContextMenuStrip to specify the behaviour of the control. For example, an action can be configured to occur when a user double clicks the control using the DoubleClick event property.

For information on configuring events and other components of the design using a script, see: Working with Scripts.

Adding a ContextMenuStrip

When you drag a ContextMenuStrip control onto a form in the Flow Designer, it will appear in the design space, and a menu will appear on the active form.

Items can be added to the ContextMenuStrip using the menu displayed in the form. Type each entry into the space provided and manage the configuration of each item by selecting it and using the Properties pane.

You can also use the control properties of the ContextMenuStrip control to select the RenderMode, margin options and Edit Items...

The Edit Items... option opens the Items Collection Editor form from which you can create and configure the menu items for your control.

Use the drop down at the top of the Items Collection Editor to select which item type you want to add and configure. For example, select the MenuItem option to add, delete and configure the menu items for your control.

You can add an instance of the selected item using the Add button at the right of the drop down list. This will add a new item to the bottom of the list in the panel at the left. You can change the order of the items in the list using the Up and Down buttons. Items can be removed from the list using the Delete button.

For each item on the menu control list, you can set the item properties, while it is selected, using the Properties pane on the right of the Items Collection Editor.

Information on the properties for various menu items can be found by searching for the item name on the Forms Help at Microsoft® Documentation. For example, information on ToolStripMenuItem can be found via the link.

When you have configured the control as required, click OK to return to the form.

To associate a ContextMenuStrip with a control in your project, select the control and use the property in the Properties pane to set the required ContextMenuStrip - as shown in the following:

With the ContextMenuStrip associated with the control, it will be accessible from the control with a right click when the form is run for the user.

More information on the configuration for the ContextMenuStrip control can be found at the link to Microsoft® Documentation.