Aspose::Words::BorderCollection class

BorderCollection class

A collection of Border objects. To learn more, visit the Programming with Documents documentation article.

class BorderCollection : public System::Collections::Generic::IEnumerable<System::SharedPtr<Aspose::Words::Border>>

Methods

MethodDescription
ClearFormatting()Removes all borders of an object.
Equals(const System::SharedPtr<Aspose::Words::BorderCollection>&)Compares collections of borders.
get_Bottom()Gets the bottom border.
get_Color()Gets or sets the border color.
get_Count()Gets the number of borders in the collection.
get_DistanceFromText()Gets or sets distance of the border from text in points.
get_Horizontal()Gets the horizontal border that is used between cells or conforming paragraphs.
get_Left()Gets the left border.
get_LineStyle()Gets or sets the border style.
get_LineWidth()Gets or sets the border width in points.
get_Right()Gets the right border.
get_Shadow()Gets or sets a value indicating whether the border has a shadow.
get_Top()Gets the top border.
get_Vertical()Gets the vertical border that is used between cells.
GetEnumerator() overrideReturns an enumerator object that can be used to iterate over all borders in the collection.
GetType() const override
idx_get(Aspose::Words::BorderType)Retrieves a Border object by border type.
idx_get(int32_t)Retrieves a Border object by index.
Is(const System::TypeInfo&) const override
set_Color(System::Drawing::Color)Setter for Aspose::Words::BorderCollection::get_Color.
set_DistanceFromText(double)Setter for Aspose::Words::BorderCollection::get_DistanceFromText.
set_LineStyle(Aspose::Words::LineStyle)Setter for Aspose::Words::BorderCollection::get_LineStyle.
set_LineWidth(double)Setter for Aspose::Words::BorderCollection::get_LineWidth.
set_Shadow(bool)Setter for Aspose::Words::BorderCollection::get_Shadow.
static Type()

Examples

Shows how to insert a paragraph with a top border.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

SharedPtr<Border> topBorder = builder->get_ParagraphFormat()->get_Borders()->idx_get(BorderType::Top);
topBorder->set_Color(System::Drawing::Color::get_Red());
topBorder->set_LineWidth(4.0);
topBorder->set_LineStyle(LineStyle::DashSmallGap);

builder->Writeln(u"Text with a red top border.");

doc->Save(ArtifactsDir + u"Border.ParagraphTopBorder.docx");

See Also