PatternFill Class

Pattern.When the object is serialized out as xml, its qualified name is x:patternFill.

Inheritance Hierarchy


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


<ChildElementInfoAttribute(GetType(ForegroundColor))> _
<ChildElementInfoAttribute(GetType(BackgroundColor))> _
Public Class PatternFill _
    Inherits OpenXmlCompositeElement
Dim instance As PatternFill
public class PatternFill : OpenXmlCompositeElement


The following table lists the possible child types:

  • ForegroundColor <x:fgColor>

  • BackgroundColor <x:bgColor>

[ISO/IEC 29500-1 1st Edition]

18.8.32 patternFill (Pattern)

This element is used to specify cell fill information for pattern and solid color cell fills. For solid cell fills (no pattern), fgColor is used. For cell fills with patterns specified, then the cell fill color is specified by the bgColor element.

Parent Elements

fill (§18.8.20)

Child Elements


bgColor (Background Color)


fgColor (Foreground Color)




patternType (Pattern Type)

Specifies the fill pattern type (including solid and none) Default is none, when missing.

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

[Note: The W3C XML Schema definition of this element’s content model (CT_PatternFill) 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


PatternFill Members

DocumentFormat.OpenXml.Spreadsheet Namespace