Syncfusion.XlsIO.Base
Example 


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

BorderAround(ExcelLineStyle) Method

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

Parameters

borderLine
Represents border line style.
Example
The following code illustrates how to apply border around 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";
            worksheet["D2"].Text = "text";
            worksheet["C3"].Text = "in";
            worksheet["D3"].Text = "cell";
            
            //Set border
            worksheet["C2:D3"].BorderAround(ExcelLineStyle.Thick);
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.2460.0.34

See Also