Aspose::Cells::IBorderCollection Class Referenceabstract

Encapsulates a collection of IBorder objects. More...

Inherits Object.

Public Member Functions

virtual intrusive_ptr< Aspose::Cells::IBorderGetObjectByIndex (Aspose::Cells::BorderType borderType)=0
 Gets the IBorder element at the specified index. More...
 
virtual void SetColor (intrusive_ptr< Aspose::Cells::Systems::Drawing::Color > color)=0
 Sets the System.Drawing.Color of all borders in the collection. More...
 
virtual void SetStyle (Aspose::Cells::CellBorderType style)=0
 Sets the style of all borders of the collection. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Drawing::Color > GetDiagonalColor ()=0
 Gets the System.Drawing.Color of Diagonal lines. More...
 
virtual void SetDiagonalColor (intrusive_ptr< Aspose::Cells::Systems::Drawing::Color > value)=0
 Sets the System.Drawing.Color of Diagonal lines. More...
 
virtual Aspose::Cells::CellBorderType GetDiagonalStyle ()=0
 Gets the style of Diagonal lines. More...
 
virtual void SetDiagonalStyle (Aspose::Cells::CellBorderType value)=0
 Sets the style of Diagonal lines. More...
 

Detailed Description

Encapsulates a collection of IBorder objects.

[C++]
//Instantiating a Workbook object
intrusive_ptr<Aspose::Cells::IWorkbook> workbook = Factory::CreateIWorkbook();
//Adding a new worksheet to the Excel object
workbook->GetIWorksheets()->Add();
//Obtaining the reference of the newly added worksheet by passing its sheet index
intrusive_ptr<Aspose::Cells::IWorksheet> worksheet = workbook->GetIWorksheets()->GetObjectByIndex(0);
//Accessing the "A1" cell from the worksheet
intrusive_ptr<Aspose::Cells::ICell> cell = worksheet->GetICells()->GetObjectByIndex(new String("A1"));
//Adding some value to the "A1" cell
cell->PutValue((StringPtr)new String("Visit Aspose!"));
intrusive_ptr<IStyle> style = cell->GetIStyle();
//Setting the line style of the top border
style->GetIBorders()->GetObjectByIndex(BorderType_TopBorder)->SetLineStyle(CellBorderType_Thick);
//Setting the color of the top border
style->GetIBorders()->GetObjectByIndex(BorderType_TopBorder)->SetColor(Color::GetBlack());
//Setting the line style of the bottom border
style->GetIBorders()->GetObjectByIndex(BorderType_BottomBorder)->SetLineStyle(CellBorderType_Thick);
//Setting the color of the bottom border
style->GetIBorders()->GetObjectByIndex(BorderType_BottomBorder)->SetColor(Color::GetBlack());
//Setting the line style of the left border
style->GetIBorders()->GetObjectByIndex(BorderType_LeftBorder)->SetLineStyle(CellBorderType_Thick);
//Setting the color of the left border
style->GetIBorders()->GetObjectByIndex(BorderType_LeftBorder)->SetColor(Color::GetBlack());
//Setting the line style of the right border
style->GetIBorders()->GetObjectByIndex(BorderType_RightBorder)->SetLineStyle(CellBorderType_Thick);
//Setting the color of the right border
style->GetIBorders()->GetObjectByIndex(BorderType_RightBorder)->SetColor(Color::GetBlack());
cell->SetIStyle(style);
//Saving the Excel file
workbook->Save(new String("C:\\book1.xls"));

Member Function Documentation

◆ GetDiagonalColor()

virtual intrusive_ptr<Aspose::Cells::Systems::Drawing::Color> Aspose::Cells::IBorderCollection::GetDiagonalColor ( )
pure virtual

Gets the System.Drawing.Color of Diagonal lines.

◆ GetDiagonalStyle()

virtual Aspose::Cells::CellBorderType Aspose::Cells::IBorderCollection::GetDiagonalStyle ( )
pure virtual

Gets the style of Diagonal lines.

◆ GetObjectByIndex()

virtual intrusive_ptr<Aspose::Cells::IBorder> Aspose::Cells::IBorderCollection::GetObjectByIndex ( Aspose::Cells::BorderType  borderType)
pure virtual

Gets the IBorder element at the specified index.

Parameters
borderTypeThe border to be retrieved.
Returns
The element at the specified index.

◆ SetColor()

virtual void Aspose::Cells::IBorderCollection::SetColor ( intrusive_ptr< Aspose::Cells::Systems::Drawing::Color >  color)
pure virtual

Sets the System.Drawing.Color of all borders in the collection.

Parameters
colorBorders' System.Drawing.Color .

◆ SetDiagonalColor()

virtual void Aspose::Cells::IBorderCollection::SetDiagonalColor ( intrusive_ptr< Aspose::Cells::Systems::Drawing::Color >  value)
pure virtual

Sets the System.Drawing.Color of Diagonal lines.

◆ SetDiagonalStyle()

virtual void Aspose::Cells::IBorderCollection::SetDiagonalStyle ( Aspose::Cells::CellBorderType  value)
pure virtual

Sets the style of Diagonal lines.

◆ SetStyle()

virtual void Aspose::Cells::IBorderCollection::SetStyle ( Aspose::Cells::CellBorderType  style)
pure virtual

Sets the style of all borders of the collection.

Parameters
styleBorders' style