Syncfusion.XlsIO.Base
Example 


ColorRGB Property (IBorder)

Sets or gets the RGB color of the border from System.Drawing.Color structure.
Syntax
'Declaration
 
Property ColorRGB As Color
'Usage
 
Dim instance As IBorder
Dim value As Color
 
instance.ColorRGB = value
 
value = instance.ColorRGB
Color ColorRGB {get; set;}
Example
The following code illustrates how to set a RGB color from System.Drawing.Color structure to the border.
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";
            
            //Set borders
            IBorders borders = worksheet["C2"].Borders;
            
            //Set border color
            borders[ExcelBordersIndex.EdgeTop].ColorRGB = Color.Red;
            borders[ExcelBordersIndex.EdgeBottom].ColorRGB = Color.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: 17.1460.0.32

See Also