Syncfusion.XlsIO.Base
Example 


Borders Property (IRange)

Gets a IBorders collection that represents the borders of a style in the Range. Read-only.
Syntax
'Declaration
 
ReadOnly Property Borders As IBorders
'Usage
 
Dim instance As IRange
Dim value As IBorders
 
value = instance.Borders
IBorders Borders {get;}
Remarks
Borders including a Range defined as part of a conditional format will be returned.
Example
The following code illustrates how to access Borders property of the Range.
using Syncfusion.XlsIO;         
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Set text
            worksheet["C2"].Text = "Sample";
            
            //Set borders
            IBorders borders = worksheet["C2"].Borders;
            
            //Set border color
            borders[ExcelBordersIndex.EdgeTop].Color = ExcelKnownColors.Red;
            borders[ExcelBordersIndex.EdgeBottom].Color = ExcelKnownColors.Blue;
            
            //Set line style
            borders[ExcelBordersIndex.EdgeTop].LineStyle = ExcelLineStyle.Thick;
            borders[ExcelBordersIndex.EdgeBottom].LineStyle = ExcelLineStyle.Thick;
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also