--- title: "ContextMenu Component Overview" ms.date: "03/30/2017" f1_keywords: - "ContextMenu" helpviewer_keywords: - "ContextMenu component [Windows Forms], about ContextMenu component" - "context menus [Windows Forms], ContextMenu component" - "shortcut menus [Windows Forms], ContextMenu component" ms.assetid: 49d6398f-d3c4-4679-84fa-1de07b68b05e --- # ContextMenu Component Overview (Windows Forms) > [!IMPORTANT] > Although and replace and add functionality to the and controls of previous versions, and are retained for both backward compatibility and future use if you choose. With the Windows Forms component, you can provide users with an easily accessible shortcut menu of frequently used commands that are associated with the selected object. The items in a shortcut menu are frequently a subset of the items from main menus that appear elsewhere in the application. A user can typically access a shortcut menu by right-clicking the mouse. On Windows Forms, shortcut menus are associated with controls. ## Key Properties You can associate a shortcut menu with a control by setting the control's property to the component. A single shortcut menu can be associated with multiple controls, but each control can have only one shortcut menu. The key property of the component is the property. You can add menu items by programmatically creating objects and adding them to the of the shortcut menu. Because the items in a shortcut menu are usually drawn from other menus, you will most frequently add items to a shortcut menu by copying them. ## See also - - -