# CreateMenu(IPanel)

> Creates an instance of AbstractGenericMenu that is valid at Runtime or within the Editor.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.6/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public static AbstractGenericMenu CreateMenu(this IPanel panel)
```

### Parameters

**** (\[IPanel]\(/engine/6000.6/script-reference/unityengine/uielements/ipanel)): The panel that will create the menu.

### Returns

| Type                                                                                                 | Description                           |
| ---------------------------------------------------------------------------------------------------- | ------------------------------------- |
| [AbstractGenericMenu](/engine/6000.6/script-reference/unityengine/uielements/abstractgenericmenu.md) | An instance of `AbstractGenericMenu`. |

### Remarks

If the `panel` is an `EditorPanel`, creates a `GenericOSMenu`. If the `panel` is a `RuntimePanel`, creates a `GenericDropdownMenu`.
