Click or drag to resize

XlsRange BorderAround Method (LineStyleType, ExcelColors)

Sets around border for current range.
Examples
The following code illustrates how to apply border around the Rangewith color from Spire.Xls.ExcelColors structure:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet["C2"].Text = "Sample";</para><para>worksheet["D2"].Text = "text";</para><para>worksheet["C3"].Text = "in";</para><para>worksheet["D3"].Text = "cell";</para><para>//Set border</para><para>worksheet["C2:D3"].BorderAround(LineStyleType.Thick , ExcelColors.Red);</para><para>//Save to file</para><para>workbook.SaveToFile("BorderAround.xlsx");</para>

Namespace: Spire.Xls.Core.Spreadsheet
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
public void BorderAround(
	LineStyleType borderLine,
	ExcelColors borderColor
)

Parameters

borderLine
Type: Spire.Xls LineStyleType
Represents border line.
borderColor
Type: Spire.Xls ExcelColors
Represents border color as ExcelColors.

Implements

IXLSRange BorderAround(LineStyleType, ExcelColors)
See Also