Add custom items (regular buttons, check buttons and sub-menus) to these menus. Use the e.Menu.Items.Add method.

Customize the existing menu items (change their captions, images, visibility, etc.).
To learn how to access the existing items, see PopupMenuShowingEventArgs.Menu.

Example

The following sample code handles the PopupMenuShowing event to customize the column header context menu before it is displayed. The code clears default menu items and adds a new command that locks a clicked column's position.