Specifies alignment for the list number or bullet.
[Visual Basic]
Public Enum ListLevelAlignment
[C#]public enum ListLevelAlignment
Remarks
Used as a value for the Alignment property.
Example
Shows how to apply custom list formatting to paragraphs when using DocumentBuilder.
[C#]
Document doc = new Document();
// Create a list based on one of the Microsoft Word list templates.
List list = doc.Lists.Add(ListTemplate.NumberDefault);
// Completely customize one list level.
ListLevel level1 = list.ListLevels[0];
level1.Font.Color = Color.Red;
level1.Font.Size = 24;
level1.NumberStyle = NumberStyle.OrdinalText;
level1.StartAt = 21;
level1.NumberFormat = "\x0000";
level1.NumberPosition = -36;
level1.TextPosition = 144;
level1.TabPosition = 144;
// Completely customize yet another list level.
ListLevel level2 = list.ListLevels[1];
level2.Alignment = ListLevelAlignment.Right;
level2.NumberStyle = NumberStyle.Bullet;
level2.Font.Name = "Wingdings";
level2.Font.Color = Color.Blue;
level2.Font.Size = 24;
level2.NumberFormat = "\xf0af"; // A bullet that looks like some sort of a star.
level2.TrailingCharacter = ListTrailingCharacter.Space;
level2.NumberPosition = 144;
// Now add some text that uses the list that we created.
// It does not matter when to customize the list - before or after adding the paragraphs.
DocumentBuilder builder = new DocumentBuilder(doc);
builder.ListFormat.List = list;
builder.Writeln("The quick brown fox...");
builder.Writeln("The quick brown fox...");
builder.ListFormat.ListIndent();
builder.Writeln("jumped over the lazy dog.");
builder.Writeln("jumped over the lazy dog.");
builder.ListFormat.ListOutdent();
builder.Writeln("The quick brown fox...");
builder.ListFormat.RemoveNumbers();
builder.Document.Save(MyDir + "Lists.CreateCustomList Out.doc");[Visual Basic]
Dim doc As Document = New Document()
' Create a list based on one of the Microsoft Word list templates.
Dim list As List = doc.Lists.Add(ListTemplate.NumberDefault)
' Completely customize one list level.
Dim level1 As ListLevel = list.ListLevels(0)
level1.Font.Color = Color.Red
level1.Font.Size = 24
level1.NumberStyle = NumberStyle.OrdinalText
level1.StartAt = 21
level1.NumberFormat = "\x0000"
level1.NumberPosition = -36
level1.TextPosition = 144
level1.TabPosition = 144
' Completely customize yet another list level.
Dim level2 As ListLevel = list.ListLevels(1)
level2.Alignment = ListLevelAlignment.Right
level2.NumberStyle = NumberStyle.Bullet
level2.Font.Name = "Wingdings"
level2.Font.Color = Color.Blue
level2.Font.Size = 24
level2.NumberFormat = "\xf0af" ' A bullet that looks like some sort of a star.
level2.TrailingCharacter = ListTrailingCharacter.Space
level2.NumberPosition = 144
' Now add some text that uses the list that we created.
' It does not matter when to customize the list - before or after adding the paragraphs.
Dim builder As DocumentBuilder = New DocumentBuilder(doc)
builder.ListFormat.List = list
builder.Writeln("The quick brown fox...")
builder.Writeln("The quick brown fox...")
builder.ListFormat.ListIndent()
builder.Writeln("jumped over the lazy dog.")
builder.Writeln("jumped over the lazy dog.")
builder.ListFormat.ListOutdent()
builder.Writeln("The quick brown fox...")
builder.ListFormat.RemoveNumbers()
builder.Document.Save(MyDir & "Lists.CreateCustomList Out.doc")Members
| Member Name | Description | Value |
| Left | The list label is aligned to the left of the number position. | 0 |
| Center | The list label is centered at the number position. | 1 |
| Right | This list label is aligned to the right of the number position. | 2 |
Requirements
Namespace: Aspose.Words.Lists
Assembly: Aspose.Words (in Aspose.Words.dll)
See Also
Aspose.Words.Lists Namespace