Aspose::Cells::Border class

Border class

Encapsulates the object that represents the cell border.

class Border

Methods

MethodDescription
Border(Border_Impl* impl)Constructs from an implementation object.
Border(const Border& src)Copy constructor.
GetArgbColor()Gets and sets the color with a 32-bit ARGB value.
GetColor()Gets or sets the System.Drawing.Color of the border.
GetLineStyle()Gets or sets the cell border type.
GetThemeColor()Gets and sets the theme color of the border.
IsNull() constChecks whether the implementation object is nullptr.
explicit operator bool() constoperator bool()
operator=(const Border& src)operator=
SetArgbColor(int32_t value)Gets and sets the color with a 32-bit ARGB value.
SetColor(const Aspose::Cells::Color& value)Gets or sets the System.Drawing.Color of the border.
SetLineStyle(CellBorderType value)Gets or sets the cell border type.
SetThemeColor(const ThemeColor& value)Gets and sets the theme color of the border.
~Border()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
Workbook workbook;

WorksheetCollection sheets = workbook.GetWorksheets();
Cell cell = sheets.Get(0).GetCells().Get(u"A1");

Style style = cell.GetStyle();
//Set top border style and color
Border border = style.GetBorders().Get(BorderType::TopBorder);
border.SetLineStyle(CellBorderType::Medium);
border.SetColor(Color{ 0xff, 0xff, 0, 0 });//Red
cell.SetStyle(style);

Aspose::Cells::Cleanup();

See Also