Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / Fill Class
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.   
    Object Model
    Fill ClassThemeColor ClassThemeColor Class
    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

    Public Constructors
     NameDescription
    Public ConstructorCreates an empty Fill object.  
    Top
    Public Properties
     NameDescription
    Public PropertyGets or sets the Color used for filling the background of a CellRowColumn or range.  
    Public PropertyGets or sets the ThemeColor used for filling the background of a CellRowColumn or range.    
    Public PropertyGets or sets the Color of the pattern used for filling a CellRowColumn or range.  
    Public PropertyGets or sets the Style of the pattern used for filling a CellRowColumn or range.  
    Public Property

    Gets or sets the ThemeColor of the pattern used for filling a CellRowColumn or range.

     
    Top
    Public Methods
     NameDescription
    Public MethodDetermines whether the specified System.Object is equal to the current System.Object.   
    Public MethodServes as a hash function for a particular type.  
    Top
    Protected Methods
    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Framework: net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also