# Linking the Context Menu to a NotifyIcon Control

Get started with Menus and Toolbars for WinForms. Create versatile menus and docking/floating toolbars. See more in documentation here.

## Content



[C1ContextMenu](/componentone/docs/win/online-menus-toolbar/) supports linking to the standard **NotifyIcon** Control.

To link a [C1ContextMenu](/componentone/docs/win/online-menus-toolbar/) to a **NotifyIcon** Control at design time, follow these steps:

1.  Double-click on the [C1ContextMenu](/componentone/docs/win/online-menus-toolbar/) control to add it to the component tray. This will also add a **C1ComponentHolder** control to the component tray.
2.  Right-click on the [C1ContextMenu](/componentone/docs/win/online-menus-toolbar/) control and select **Edit** from its context menu. A **New Command** item will appear on the form.
3.  Right-click the **New Command** item and select **Edit** from its context menu to open the **Link to Command** designer.
4.  Change the following command properties in the **Link to Command** designer:
    *   Change the **Name** textbox text to **MenuFile**.
    *   Change the **Text** textbox text to **Menu**.
5.  Select [C1CommandMenu](/componentone/docs/win/online-menus-toolbar/) from the Create a new command listbox.
6.  Select **OK** in the **Link to Command** designer and the new menu will appear on the form.
7.  Right-click the **New Command** item in the Menu and select **Edit** from its context menu to open the **Link to Command** designer.
8.  Change the following properties in the **Link to Command** designer:
    *   Change the **Name** textbox text to **OpenFile**.
    *   Change the **Text** textbox tect to **Open**.
9.  Select **View | Properties** from the Visual Studio toolbar. Select **C1ContextMenu1** from the drop-down list at the top of the Properties window.
10.  Set the [C1ContextMenu](/componentone/docs/win/online-menus-toolbar/) property to **C1ContextMenu1**.
11.  Double-click the **NotifyIcon** component in the Windows Forms Toolbox to add the component to the component tray.
12.  Right-click on the component and select **Choose an icon** from its context menu. Choose an icon to represent the component at run time.
13.  Select **View | Properties** from the Visual Studio toolbar. Select **notifyicon1** from the drop-down list at the top of the Properties window.
14.  Set the [C1ContextMenu](/componentone/docs/win/online-menus-toolbar/) property to **C1ContextMenu1** to link the two components.
15.  Run your application. The icon you chose to represent the **NotifyIcon** component will appear in the System Tray. Note that when you right-click the icon, the context menu opens.

### This topic illustrates

Linking a C1ContextMenu to a standard Windows Forms control.

<br />![Windowd Forms control](https://cdn.mescius.io/document-site-files/images/a27cb622-e6d9-4efc-a0b0-0c31245fd632/imagesext/image10_40.png)

## See Also

[Adding a ContextMenu to a DockingTab](/componentone/docs/win/online-menus-toolbar/menusandtoolbarsforw2/contextmenutasks/addingac1contextmenu1)