# NewSubMenu

int NewSubMenu (int menuBarHandle, int menuItemID);

## Purpose

Creates a submenu, attaches it to a specific menu item, and returns a submenu ID you use to specify the submenu in subsequent function calls.

A submenu appears as a triangle on the right side of the menu item.

## Parameters

Input
Name | Type | Description
menuBarHandle | integer | Specifier for a particular menu bar that is currently in memory. You obtain this handle from LoadMenuBar or NewMenuBar. If the menu bar was automatically loaded through LoadPanel, use GetPanelMenuBar to get the menu bar handle.
menuItemID | integer | Menu item to which to attach the submenu. The menu item ID must be a constant name you assign in the User Interface Editor or a value you obtain from NewMenuItem.

## Return Value

Name | Type | Description
subMenuID | integer | ID that you use to specify this submenu in subsequent function calls. Negative values indicate that an error occurred. Zero is not a valid ID.
Code | Error Message String
xx | Success