Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / Fill Class
Members Example


In This Topic
    Fill Class
    In This Topic
    Contains the properties related to filling a CellRowColumn or range with a Color and a pattern.   
    Syntax
    'Declaration
     
    
    Public Class Fill 
       Inherits Xceed.Workbooks.NET.StyleBase(Of IReadonlyFill)
       Implements IReadonlyFill 
    'Usage
     
    
    Dim instance As Fill
    Remarks
    This class derives from StyleBase<IReadonlyFill> and IReadonlyFill.
    Example
    using( var workbook = Workbook.Create( "test.xlsx" ) )
      {
        // Get the first worksheet. A workbook contains at least 1 worksheet.
        var cellWorksheet = workbook.Worksheets[ 0 ];
    
        // Set fill style for cell C12.
        cellWorksheet.Cells[ "C12" ].Style.Fill = new Fill() { PatternStyle = FillPattern.ThinDiagonalCrosshatch, PatternColor = Color.Green,  BackgroundColor = Color.Blue };
        // Set Cell C12 content.
        cellWorksheet.Cells[ "C12" ].Value = "Testing Fill Pattern";
    
        // Save workbook to disk.
        workbook.Save();
      }
    Inheritance Hierarchy

    System.Object
       Xceed.Workbooks.NET.StyleBase<T>
          Xceed.Workbooks.NET.Fill

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also