BorderCollection Class
A collection of Border objects.
Inheritance Hierarchy
SystemObject
  Aspose.WordsBorderCollection

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.11
Syntax
public sealed class BorderCollection : IEnumerable<Border>, 
	IEnumerable

The BorderCollection type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleBottom
Gets the bottom border.
Public propertyCode exampleColor
Gets or sets the border color.
Public propertyCode exampleCount
Gets the number of borders in the collection.
Public propertyCode exampleDistanceFromText
Gets or sets distance of the border from text in points.
Public propertyCode exampleHorizontal
Gets the horizontal border that is used between cells or conforming paragraphs.
Public propertyCode exampleItemInt32
Retrieves a Border object by index.
Public propertyCode exampleItemBorderType
Retrieves a Border object by border type.
Public propertyCode exampleLeft
Gets the left border.
Public propertyCode exampleLineStyle
Gets or sets the border style.
Public propertyCode exampleLineWidth
Gets or sets the border width in points.
Public propertyCode exampleRight
Gets the right border.
Public propertyCode exampleShadow
Gets or sets a value indicating whether the border has a shadow.
Public propertyCode exampleTop
Gets the top border.
Public propertyCode exampleVertical
Gets the vertical border that is used between cells.
Methods
  NameDescription
Public methodCode exampleClearFormatting
Removes all borders of an object.
Public methodEquals(Object) (Inherited from Object.)
Public methodCode exampleEquals(BorderCollection)
Compares collections of borders.
Public methodCode exampleGetEnumerator
Returns an enumerator object that can be used to iterate over all borders in the collection.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString (Inherited from Object.)
Remarks
Different document elements have different borders. For example, ParagraphFormat has Bottom, Left, Right and Top borders. You can specify different formatting for each border independently or enumerate through all borders and apply same formatting.
Examples
Inserts a paragraph with a top border.
DocumentBuilder builder = new DocumentBuilder();

Border topBorder = builder.ParagraphFormat.Borders[BorderType.Top];
topBorder.Color = Color.Red;
topBorder.LineStyle = LineStyle.DashSmallGap;
topBorder.LineWidth = 4;

builder.Writeln("Hello World!");
See Also