Partager via


ControlProperties Class

Defines the ControlProperties Class.This class is only available in Office2010.When the object is serialized out as xml, its qualified name is x:controlPr.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Spreadsheet.ControlProperties

Namespace:  DocumentFormat.OpenXml.Spreadsheet
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(ObjectAnchor), FileFormatVersions.Office2010)> _
<OfficeAvailabilityAttribute(FileFormatVersions.Office2010)> _
Public Class ControlProperties _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As ControlProperties
[ChildElementInfoAttribute(typeof(ObjectAnchor), FileFormatVersions.Office2010)]
[OfficeAvailabilityAttribute(FileFormatVersions.Office2010)]
public class ControlProperties : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • ObjectAnchor <x:anchor>

[ISO/IEC 29500-1 1st Edition]

18.3.1.20 controlPr (Embedded Control Properties)

This element specifies the visual, positional and cell linkage properties of an embedded control.

[Example: The following example demonstrates an non-printing embedded control linked to cell A4 that is represented as an image:

<controls>
  <control … >
    <controlPr print="false" autoLine="false" linkedCell="$A$4" cf="pict" r:id="rId5">
      <anchor sizeWithCells="true">
        <from> … </from>
        <to> … </to>
      </anchor>
    </controlPr>
  </control>
</controls>

end example]

Parent Elements

control (§18.3.1.19)

Child Elements

Subclause

anchor (Object Cell Anchor)

§18.3.1.1

Attributes

Description

altText (Alternative Text)

Specifies alternative text for the object, for use by assistive technologies or applications.

[Example:

<controlPr altText="Alternate text" … />

end example]

The possible values for this attribute are defined by the ST_Xstring simple type (§22.9.2.19).

autoFill (Automatic Fill Flag)

Specifies whether the object’s fill formatting is provided automatically by the application.

[Example:

<controlPr autoFill="false" … />

end example]

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

autoLine (Automatic Line Flag)

Specifies whether the object’s line formatting is provided automatically by the application.

[Example:

<controlPr autoLine="false" … />

end example]

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

autoPict (Automatic Size Flag)

Specifies whether the object’s size is formatted automatically by the application.

[Example:

<controlPr autoPict="false" … />

end example]

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

cf (Image Format)

Specifies the image format used to render the object.

[Example:

<controlPr cf="pict" … />

end example]

The possible values for this attribute are defined by the ST_Xstring simple type (§22.9.2.19).

defaultSize (Default Size Flag)

Specifies whether the object is at its default size.

[Example:

<controlPr defaultSize="false" … />

end example]

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

disabled (Disabled Flag)

Specifies whether the object is allowed to run an attached macro.

[Example:

<controlPr disabled="true" … />

end example]

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

id (Relationship ID for Embedded Control Properties)

Namespace: .../officeDocument/2006/relationships

Specifies the relationship ID for the relationship which contains the properties for this embedded control. This property bag is contained in a separate part within the package.

The relationship explicitly targeted by this attribute shall be of relationship type https://schemas.openxmlformats.org/officeDocument/2006/relationships/control or the document shall be conisdered non-conformant.

If this attribute is omitted, then the embedded control shall be given no property bag when instantiated.

[Example: Consider the following WordprocessingML markup for an embedded control in a document:

<w:control r:id="rId5" w:id="CheckBox1" w:name="CheckBox1" w:shapeid="_x0000_s1027" w:class="shape" w:w="145" w:h="28" w:align="left" />

The id attribute in the relationship reference namespace specifies that the relationship with relationship ID rId5 must contain the property data for this embedded control. end example]

The possible values for this attribute are defined by the ST_RelationshipId simple type (§22.8.2.1).

linkedCell (Linked Formula)

Specifies the cell the control is linked to, using standard cell A1-style reference syntax as described in §18.17.2.3.1. The value in the linked cell and the index of the selected item in the object are linked together. This link is ignored if the control allows multiple selections.

[Example:

<controlPr linkedCell="$A$4" … />

end example]

The possible values for this attribute are defined by the ST_Formula simple type (§18.18.35).

listFillRange (List Items Source Range)

Specifies the range of source data cells used to populate the list box, using standard A1-style cell reference syntax as described in §18.17.2.3.1.

[Example:

<controlPr listFillRange="$A$1:$A$15" … />

end example]

The possible values for this attribute are defined by the ST_Formula simple type (§18.18.35).

locked (Locked Flag)

Specifies that the object is locked when the sheet is protected.

[Example:

<controlPr locked="false" … />

end example]

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

macro (Custom Function)

Specifies the custom function associated with the object. [Example: A macro script, add-in function, and so on. end example]

[Example:

<controlPr macro="Button1_Click()" … />

end example]

The possible values for this attribute are defined by the ST_Formula simple type (§18.18.35).

print (Print Flag)

Specifies whether the object is printed when the document is printed.

[Example:

<controlPr print="false" … />

end example]

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

recalcAlways (Recalculation Flag)

Specifies whether the object is always included in recalculation. This is used by controls that reference cells in the spreadsheet to update themselves when the spreadsheet changes.

[Example:

<controlPr recalcAlways="true" … />

end example]

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

uiObject (UI Object Flag)

Specifies whether the object is a UI-only object. Applications should prevent UI-only objects from being selected and edited in their user interface.

[Example:

<objectPr uiObject="true" … />

end example]

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

[Note: The W3C XML Schema definition of this element’s content model (CT_ControlPr) is located in §A.2. end note]

© ISO/IEC29500: 2008.

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

ControlProperties Members

DocumentFormat.OpenXml.Spreadsheet Namespace