Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / Style Class / Borders Property
Example


In This Topic
    Borders Property (Style)
    In This Topic
    Gets the collection of active Borders in a Style.
    Syntax
    'Declaration
     
    
    Public ReadOnly Property Borders As BorderCollection
    'Usage
     
    
    Dim instance As Style
    Dim value As BorderCollection
     
    instance.Borders = value
     
    value = instance.Borders
    public BorderCollection Borders {get;}
    Remarks
    Returns an empty collection by default.
    Example
    var workbook = Workbook.Create( "test.xlsx" )
    
    // Get first worksheet.
    var worksheet = workbook.Worksheets[ 0 ];
    
    // Set cells content.
    worksheet.Cells[ "B15" ].Value = 0.1;
    
    worksheet.Cells[ "C15" ].Value = 0.22;
    worksheet.Cells[ "B16" ].Value = 0.31;
    worksheet.Cells[ "C16" ].Value = 0.5;
    worksheet.Cells[ "B17" ].Value = 0.36;
    worksheet.Cells[ "C17" ].Value = 0.25;
    
    // Get CellRange from B15 to C17 and modify the Borders of the 6 cells.
    var cellRange = worksheet.Cells[ "B15", "C17" ];
    cellRange.Style.Borders.SetInside( LineStyle.Medium, Color.DarkGreen );
    cellRange.Style.Borders.SetOutline( LineStyle.Medium, Color.DarkGreen );
    
    // Save workbook to disk.
    workbook.Save();
    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