Click or drag to resize
ListStyleListLevelFormats Property
Gets the formatting for each list style level.

Namespace: GemBox.Document
Assembly: GemBox.Document (in GemBox.Document.dll) Version:
public ListLevelFormatCollection ListLevelFormats { get; }

Property Value

Type: ListLevelFormatCollection
The formatting for each list style level.

List (for example, ordered - with numbers, or unordered - with bullets) appearance in GemBox.Document is defined through ListFormat class that is set on Paragraph's ListFormat property.

ListFormat is different from other formattings (ParagraphFormat and CharacterFormat) because it doesn't directly contain any formatting properties.

It contains a reference to a ListStyle which exposes ListLevelFormats for every list (indentation) level through its ListLevelFormats property.

ListLevelFormats contain direct formatting properties that affect the appearance of the list. Every ListStyle contains exactly 9 ListLevelFormats, one for each possible list (indentation) level.

Paragraph's list (indentation) level can be adjusted with ListFormat.ListLevelNumber property. Paragraph's list-related formatting will then be collected from the ListLevelFormat instance contained in the ListStyle.ListLevelFormats at the position ListFormat.ListLevelNumber. This ListLevelFormat can also be retrieved from the ListFormat.ListLevelFormat property.

To create a list in a document, first ListStyle instance has to be created from one of the predefined list style types specified with ListTemplateType enumeration, and added to Styles collection, like any other Style. After that, ListFormat can be created with a specified ListStyle and assigned to a Paragraph's ListFormat property. For a complete example, see Lists sample.

See Also