

'DeclarationPublic Class Style Inherits Xceed.Workbooks.NET.StyleBase(Of IReadonlyStyle) Implements IReadonlyStyle
'UsageDim instance As Style
public class Style : Xceed.Workbooks.NET.StyleBase<IReadonlyStyle>, IReadonlyStyle
using( var doc = Workbook.Load( "test.xlsx") ) { var worksheet = doc.Worksheets[ 0 ]; worksheet.Cells[ 1, 1 ].Value = 25.6; // Sets “B2” Value. worksheet.Cells[ 1, 1 ].Style.CustomFormat = "$0.0000"; // Sets “B2” display format to show “$25.6000”. worksheet.Cells[ 2, 2 ].Value = new DateTime( 2021, 7, 1, 10, 22, 33 ); // Sets “C3” Value. worksheet.Cells[ 2, 2 ].Style.CustomFormat = "h:mm AM/PM"; // Sets “C3” display format to show “10:22 AM”. worksheet.Cells[ “D4” ].Value = 33.5; worksheet.Cells[ “D4” ].Style.PredefinedNumberFormatId = 2; // Sets “D4” display format to “0.00” to show “33.50”. doc.Save(); }
System.Object
Xceed.Workbooks.NET.StyleBase<T>
Xceed.Workbooks.NET.Style
| Name | Description | |
|---|---|---|
![]() | Style Constructor |
| Name | Description | |
|---|---|---|
![]() | Alignment | Gets or sets the Horizontal & Vertical Alignment used to align the content of a Cell. |
![]() | Borders | Gets the collection of active Borders in a Style. |
![]() | BuiltinType | Gets or sets the BuiltinStyleType. |
![]() | CustomFormat | Gets or sets the format used to display the content of a Cell, the Cells in a Column or the Cells in a Row. |
![]() | Fill | Gets or sets the Fill used to fill the background of a Cell, Column, Row or range. |
![]() | Font | Gets or sets the Font that will be used by the Style. |
![]() | PredefinedNumberFormatId | Gets or sets the predefined number format that will be used to format the content of a Cell, the Cells in a Column or the Cells in a Row. |
![]() | Protection | Gets or sets the Protection associated with the Style. |
| Name | Description | |
|---|---|---|
![]() | Equals | Determines whether the specified System.Object is equal to the current System.Object. |
![]() | GetHashCode | Serves as a hash function for a particular type. |
![]() | RevertToDefault | Resets the Style of the Cell, Row or Column back to its default setting. |
| Name | Description | |
|---|---|---|
![]() | OnPropertyChanged | (Inherited from Xceed.Workbooks.NET.StyleBase<IReadonlyStyle>) |
.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.