Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IRange Interface > BorderAround Method : BorderAround(ExcelLineStyle,Color) Method
Represents border line style.
Represents border color.

BorderAround(ExcelLineStyle,Color) Method

Applies border around the Range with the specified ExcelLineStyle and System.Drawing.Color.
Syntax
'Declaration
 
Overloads Sub BorderAround( _
   ByVal borderLine As ExcelLineStyle, _
   ByVal borderColor As Color _
) 
'Usage
 
Dim instance As IRange
Dim borderLine As ExcelLineStyle
Dim borderColor As Color
 
instance.BorderAround(borderLine, borderColor)
void BorderAround( 
   ExcelLineStyle borderLine,
   Color borderColor
)

Parameters

borderLine
Represents border line style.
borderColor
Represents border color.
Example
The following code illustrates how to apply border around the Range with color from System.Drawing.Color structure.
using Syncfusion.XlsIO;
using System.Drawing;
            
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";
            worksheet["D2"].Text = "text";
            worksheet["C3"].Text = "in";
            worksheet["D3"].Text = "cell";
            
            //Set border
            worksheet["C2:D3"].BorderAround(ExcelLineStyle.Thick, Color.Red);
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.2460.0.34

See Also