Xceed Workbooks for .NET v2.0 Documentation
BorderCollection Class
Members  Example 


Xceed.Workbooks.NET Assembly > Xceed.Workbooks.NET Namespace : BorderCollection Class
Defines the collection of Borders for a Style.
Syntax
'Declaration
 
<DefaultMemberAttribute("Item")>
Public Class BorderCollection 
   Inherits Xceed.Workbooks.NET.StyleBase(Of BorderCollection)
'Usage
 
Dim instance As BorderCollection
[DefaultMember("Item")]
public class BorderCollection : Xceed.Workbooks.NET.StyleBase<BorderCollection> 
Remarks
Derives from StyleBase.
Example
using( var workbook = Workbook.Create( "AddBorder.xlsx" ) ) 
  { 
    // Gets the first Worksheet; a Workbook always contains at least 1 Worksheet. 
    var worksheet = workbook.Worksheets[ 0 ]; 

    // Gets the Border collection for Cell A2. 
    var borders = worksheet.Cells[ "A2" ].Style.Borders; 

    // Sets the color and style of the rightmost Border. 
    borders[ BorderType.Right ].Style = LineStyle.Thick; 
    borders[ BorderType.Right ].Color = Color.Red; 

    // Saves Workbook to disk; 
    workbook.Save(); 
  }
Inheritance Hierarchy

System.Object
   Xceed.Workbooks.NET.StyleBase<T>
      Xceed.Workbooks.NET.BorderCollection

Requirements

Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

BorderCollection Members
Xceed.Workbooks.NET Namespace