property Item.SubMenu as Menu
Retrieves a Menu object that indicates the item's sub menu. Retrieves Nothing, if the item contains no sub menu.

TypeDescription
Menu A Menu object that contains the submenu items
If the item contains no sub  menu, the Popup property retrieves False. If the Popup retrieves True, the SubMenu property gets the collection of items in the sub menu. Use Add method to add new items to menu. Use the VisibleItemsCount property to specify whether the sub menu displays the scroll buttons.

The following VB sample adds a submenu:

With ExMenu1
        With .Items
            With .Add("Popup", EXMENULibCtl.ItemTypeEnum.SubMenu).SubMenu
                .Add "Child 1"
            End With
        End With
        .Refresh
End With

The following VB sample adds a submenu:

With ExMenu1
        With .Items
            With .Add("Popup")
                .Popup = True
                With .SubMenu
                    .Add "Child 1"
                End With
            End With
        End With
        .Refresh
End With

The following C++ sample adds a submenu:

COleVariant vtMissing; V_VT( &vtMissing ) = VT_ERROR;
CItem item = m_menu.GetItems().Add( "Popup", COleVariant( long(2) /*SubMenu*/ ), COleVariant( (long)1234 ) );
item.GetSubMenu().Add( "Child 1", vtMissing , vtMissing );
m_menu.Refresh();

The following C++ sample adds a submenu:

COleVariant vtMissing; V_VT( &vtMissing ) = VT_ERROR;
CItem item = m_menu.GetItems().Add( "Popup", vtMissing, COleVariant( (long)1234 ) );
item.SetPopup( TRUE );
item.GetSubMenu().Add( "Child 1", vtMissing , vtMissing );
m_menu.Refresh();

The following VB.NET sample adds a submenu:

With AxExMenu1.Items
    With .Add("Popup", EXMENULib.ItemTypeEnum.SubMenu, 1234).SubMenu
        .Add("Child")
    End With
End With
AxExMenu1.CtlRefresh()

The following VB.NET sample adds a submenu:

With AxExMenu1.Items
    Dim i As EXMENULib.item = .Add("Popup", , 1234)
    i.Popup = True
    With i.SubMenu
        .Add("Child")
    End With
End With
AxExMenu1.CtlRefresh()

The following C# sample adds a submenu:

EXMENULib.item item = axExMenu1.Items.Add("Popup", EXMENULib.ItemTypeEnum.SubMenu, 1234);
EXMENULib.Menu subMenu = item.SubMenu;
subMenu.Add("Child 1", null, null);
axExMenu1.CtlRefresh();

The following C# sample adds a submenu:

EXMENULib.item item = axExMenu1.Items.Add("Popup", null, 1234);
item.Popup = true;
EXMENULib.Menu subMenu = item.SubMenu;
subMenu.Add("Child 1", null, null);
axExMenu1.CtlRefresh();

The following VFP sample adds a submenu:

With thisform.ExMenu1.Items
    with .Add("Popup", 2, 1234).SubMenu
		.Add("Child")
	endwith
EndWith
thisform.ExMenu1.Object.Refresh

The following VFP sample adds a submenu:

With thisform.ExMenu1.Items
    with .Add("Popup", , 1234)
    .Popup = .t.
	    With .SubMenu
	        .Add("Child")
	    EndWith
	endwith
EndWith
thisform.ExMenu1.Object.Refresh