Xceed Workbooks for .NET v1.4 Documentation
Border Class
Members  Example 


Xceed.Workbooks.NET Assembly > Xceed.Workbooks.NET Namespace : Border Class
Defines the content of a specific border.
Syntax
'Declaration

 

Public Class Border 

   Inherits Xceed.Workbooks.NET.StyleBase(Of IReadonlyBorder)

   Implements IReadonlyBorder 
'Usage

 

Dim instance As Border
Remarks
Derives from StyleBase and IReadonlyBorder.
Example
var workbook = Workbook.Create("test.xlsx" )



// Get the first worksheet. A workbook contains at least 1 worksheet.

var cellWorksheet = workbook.Worksheets[ 0 ];



// Set cell content and Border styles.

cellWorksheet.Cells[ "C5" ].Value = "Bottom";

cellWorksheet.Cells[ "C5" ].Style.Borders[ BorderType.Bottom ].Style = LineStyle.Double;

cellWorksheet.Cells[ "C5" ].Style.Borders[ BorderType.Bottom ].Color = Color.Red;



cellWorksheet.Cells[ "C8" ].Value = "Top";

cellWorksheet.Cells[ "C8" ].Style.Borders[ BorderType.Top ].Style = LineStyle.DashDot;



cellWorksheet.Cells[ "C11" ].Value = "Right";

cellWorksheet.Cells[ "C11" ].Style.Borders[ BorderType.Right ] = new Border() { Style = LineStyle.MediumDashed, Color = Color.Green };



// Save workbook to disk.

workbook.Save();
Inheritance Hierarchy

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

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

Border Members
Xceed.Workbooks.NET Namespace