# AddMenuItem

## Introduction

The AddMenuItem function allows adding menu items to Gum. The AddMenuItem accepts an enumerable of strings which allow you to embed menu items under a root menu item.

## Code Example

The following shows how to create a menu item called "My Plugin" which contains two items: First and Second. Clicking each item results in a message box appearing. Add the following to your plugin's **StartUp** function.

```
// Add startup logic here:
var firstMenuItem = 
    AddMenuItem(new List<string> { "My Plugin", "First" });

firstMenuItem.Click += (args, sender) => 
    System.Windows.Forms.MessageBox.Show("You clicked first");

var secondMenuItem =
    AddMenuItem(new List<string> { "My Plugin", "Second" });

secondMenuItem.Click += (args, sender) =>
    System.Windows.Forms.MessageBox.Show("You clicked second");
```

![](https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-089a28d257904e72304fbbcf0ced34081b8b5f7a%2FBeforeClickingFirstGum.png?alt=media)
