Compartir a través de


MaxLength Class

Text Box Form Field Maximum Length.When the object is serialized out as xml, its qualified name is w:maxLength.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.MaxLength

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

Syntax

'Declaration
Public Class MaxLength _
    Inherits OpenXmlLeafElement
'Usage
Dim instance As MaxLength
public class MaxLength : OpenXmlLeafElement

Remarks

[ISO/IEC 29500-1 1st Edition]

17.16.21 maxLength (Text Box Form Field Maximum Length)

This element specifies the maximum length of text which should be allowed within the parent text box form field before any formatting specified by the format element (§17.16.20). If the current contents of this field exceed the specified value when the document is loaded, that violation shall not result in an error, but the application shall prevent the addition of any additional characters until the contents are brought below that limit.

If this element is omitted, then there shall be no limit on the number of characters in the parent text box form field.

[Example: Consider the following WordprocessingML fragment for the properties of a text box form field:

<w:ffData>
<w:textInput>
<w:type w:val="number" />
<w:maxLength w:val="4" />
<w:format w:val="0.00" />
</w:textInput>
</w:ffData>

The maxLength element specifies that the contents of this form field should not be allowed to exceed four characters when edited by an application. end example]

Parent Elements

textInput (§17.16.33)

Attributes

Description

val (Decimal Number Value)

Specifies that the contents of this attribute contains a decimal number.

The contents of this decimal number are interpreted based on the context of the parent XML element.

[Example: Consider the following numeric WordprocessingML property of simple type ST_DecimalNumber:

<… w:val="1512645511" />

The value of the val attribute is a decimal number whose value must be interpreted in the context of the parent element. end example]

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

[Note: The W3C XML Schema definition of this element’s content model (CT_DecimalNumber) is located in §A.1. 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

MaxLength Members

DocumentFormat.OpenXml.Wordprocessing Namespace