ContextMenu Class

Defines the ContextMenu Class.This class is only available in Office2010.When the object is serialized out as xml, its qualified name is mso14:contextMenu.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Office2010.CustomUI.ContextMenu

Namespace:  DocumentFormat.OpenXml.Office2010.CustomUI
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(MenuSeparatorNoTitle), FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(SplitButtonRegular), FileFormatVersions.Office2010)> _
<OfficeAvailabilityAttribute(FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(DynamicMenuRegular), FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(ControlCloneRegular), FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(GalleryRegular), FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(MenuRegular), FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(ToggleButtonRegular), FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(ButtonRegular), FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(CheckBox), FileFormatVersions.Office2010)> _
Public Class ContextMenu _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As ContextMenu
[ChildElementInfoAttribute(typeof(MenuSeparatorNoTitle), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(SplitButtonRegular), FileFormatVersions.Office2010)]
[OfficeAvailabilityAttribute(FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(DynamicMenuRegular), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(ControlCloneRegular), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(GalleryRegular), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(MenuRegular), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(ToggleButtonRegular), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(ButtonRegular), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(CheckBox), FileFormatVersions.Office2010)]
public class ContextMenu : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • ControlCloneRegular <mso14:control>

  • ButtonRegular <mso14:button>

  • CheckBox <mso14:checkBox>

  • GalleryRegular <mso14:gallery>

  • ToggleButtonRegular <mso14:toggleButton>

  • SplitButtonRegular <mso14:splitButton>

  • MenuRegular <mso14:menu>

  • DynamicMenuRegular <mso14:dynamicMenu>

  • MenuSeparatorNoTitle <mso14:menuSeparator>

2.3.44 CT_ContextMenu

Target namespace: https://schemas.microsoft.com/office/2007/10/customui

Referenced by: CT_ContextMenus

Specifies a built-in context menu control.

Child Elements:

control : A CT_ControlCloneRegular element.

button : A CT_ButtonRegular element.

checkBox : A CT_CheckBox element.

gallery : A CT_GalleryRegular element.

toggleButton : A CT_ToggleButtonRegular element.

splitButton : A CT_SplitButtonRegular element.

menu : A CT_MenuRegular element.

dynamicMenu : A CT_DynamicMenuRegular element.

menuSeparator : A CT_MenuSeparatorNoTitle element.

Attributes:

idMso : An ST_ID attribute that specifies the identifier of a built-in control. The id, idQ and idMso attributes are mutually exclusive. Exactly one of these attributes MUST be specified.

The following W3C XML Schema ([XMLSCHEMA1] section 2.1) fragment specifies the contents of this complex type.

<xsd:complexType name="CT_ContextMenu">

<xsd:sequence>

<xsd:choice minOccurs="0" maxOccurs="1000">

<xsd:group ref="EG_ContextMenuControls"/>

</xsd:choice>

</xsd:sequence>

<xsd:attributeGroup ref="AG_IDMso"/>

</xsd:complexType>

See section 5.1 for the full W3C XML Schema ([XMLSCHEMA1] section 2.1).

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

ContextMenu Members

DocumentFormat.OpenXml.Office2010.CustomUI Namespace