Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / BorderCollection Class
Members Example


In This Topic
    BorderCollection Class
    In This Topic
    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

    Public Properties
     NameDescription
    Public PropertyGets or sets a specific Border in the BorderCollection.  
    Top
    Public Methods
     NameDescription
    Public MethodDetermines whether the specified System.Object is equal to the current System.Object.  
    Public MethodServes as a hash function for a particular type.  
    Public MethodSets the DiagonalUp and DiagonalDown Borders using the same LineStyle and Color.  
    Public MethodSets the Horizontal and Vertical Borders using the same LineStyle and Color.  
    Public MethodSets the LeftRightTop and Bottom Borders using the same LineStyle and Color.  
    Public MethodSets the DiagonalUp and DiagonalDown Borders using the same LineStyle and ThemeColor.  
    Public MethodSets the Horizontal and Vertical Borders using the same LineStyle and ThemeColor.  
    Public MethodSets the LeftRightTop and Bottom Borders using the same LineStyle and ThemeColor.  
    Top
    Protected Methods
    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