Style Class

Style class

Represents display style of excel document,such as font,color,alignment,border,etc.The Style object contains all style attributes (font, number format, alignment, and so on) as properties.


type Style struct  {
	ptr unsafe.Pointer
}

Constructors

MethodDescription

Methods

MethodDescription
IsNullChecks whether the implementation object is nullptr.
GetBackgroundThemeColorGets and sets the background theme color.
SetBackgroundThemeColorGets and sets the background theme color.
GetForegroundThemeColorGets and sets the foreground theme color.
SetForegroundThemeColorGets and sets the foreground theme color.
GetNameGets or sets the name of the style.
SetNameGets or sets the name of the style.
GetPatternGets or sets the cell background pattern type.
SetPatternGets or sets the cell background pattern type.
SetPatternColorSets the background color.
GetBordersGets the of the style.
GetBackgroundColorGets or sets a style’s background color.
SetBackgroundColorGets or sets a style’s background color.
GetBackgroundArgbColorGets and sets the background color with a 32-bit ARGB value.
SetBackgroundArgbColorGets and sets the background color with a 32-bit ARGB value.
GetForegroundColorGets or sets a style’s foreground color.
SetForegroundColorGets or sets a style’s foreground color.
GetForegroundArgbColorGets and sets the foreground color with a 32-bit ARGB value.
SetForegroundArgbColorGets and sets the foreground color with a 32-bit ARGB value.
CopyCopies data from another style object
GetHasBordersChecks whether there are borders have been set for the style.
GetParentStyleGets the parent style of this style.
UpdateApply the named style to the styles of the cells which use this named style.It works like clicking the “ok” button after you finished modifying the style.Only applies for named style.
IsNumberFormatAppliedIndicate whether the number formatting should be applied.
SetIsNumberFormatAppliedIndicate whether the number formatting should be applied.
IsFontAppliedIndicate whether the font formatting should be applied.
SetIsFontAppliedIndicate whether the font formatting should be applied.
IsAlignmentAppliedIndicate whether the alignment formatting should be applied.
SetIsAlignmentAppliedIndicate whether the alignment formatting should be applied.
IsBorderAppliedIndicate whether the border formatting should be applied.
SetIsBorderAppliedIndicate whether the border formatting should be applied.
IsFillAppliedIndicate whether the fill formatting should be applied.
SetIsFillAppliedIndicate whether the fill formatting should be applied.
IsProtectionAppliedIndicate whether the protection formatting should be applied.
SetIsProtectionAppliedIndicate whether the protection formatting should be applied.
IsModifiedChecks whether the specified properties of the style have been modified.Used for style of ConditionalFormattings to check whether the specified properties of this style should be used when applying the ConditionalFormattings on a cell.
EqualsDetermines whether two Style instances are equal.
GetHashCodeServes as a hash function for a Style object.
GetIndentLevelRepresents the indent level for the cell or range. Can only be an integer from 0 to 250.
SetIndentLevelRepresents the indent level for the cell or range. Can only be an integer from 0 to 250.
GetFontGets a object.
GetRotationAngleRepresents text rotation angle.
SetRotationAngleRepresents text rotation angle.
GetHorizontalAlignmentGets or sets the horizontal alignment type of the text in a cell.
SetHorizontalAlignmentGets or sets the horizontal alignment type of the text in a cell.
GetVerticalAlignmentGets or sets the vertical alignment type of the text in a cell.
SetVerticalAlignmentGets or sets the vertical alignment type of the text in a cell.
IsTextWrappedGets or sets a value indicating whether the text within a cell is wrapped.
SetIsTextWrappedGets or sets a value indicating whether the text within a cell is wrapped.
GetNumberGets or sets the display format of numbers and dates. The formatting patterns are different for different regions.
SetNumberGets or sets the display format of numbers and dates. The formatting patterns are different for different regions.
SetBorder_BorderType_CellBorderType_ColorSets the borders of the style.
SetBorder_BorderType_CellBorderType_CellsColorSets the borders of the style.
IsLockedGets or sets a value indicating whether a cell can be modified or not.
SetIsLockedGets or sets a value indicating whether a cell can be modified or not.
SetCustom_String_BoolSets the Custom number format string of a cell.
GetCustomRepresents the custom number format string of this style object.If the custom number format is not set(For example, the number format is builtin), "" will be returned.
SetCustom_StringRepresents the custom number format string of this style object.If the custom number format is not set(For example, the number format is builtin), "" will be returned.
GetCultureCustomGets and sets the culture-dependent pattern string for number format.If no number format has been set for this object, null will be returned.If number format is builtin, the pattern string corresponding to the builtin number will be returned.
SetCultureCustomGets and sets the culture-dependent pattern string for number format.If no number format has been set for this object, null will be returned.If number format is builtin, the pattern string corresponding to the builtin number will be returned.
GetInvariantCustomGets the culture-independent pattern string for number format.If no number format has been set for this object, null will be returned.If number format is builtin, the pattern string corresponding to the builtin number will be returned.
IsFormulaHiddenRepresents if the formula will be hidden when the worksheet is protected.
SetIsFormulaHiddenRepresents if the formula will be hidden when the worksheet is protected.
GetShrinkToFitRepresents if text automatically shrinks to fit in the available column width.
SetShrinkToFitRepresents if text automatically shrinks to fit in the available column width.
GetTextDirectionRepresents text reading order.
SetTextDirectionRepresents text reading order.
IsJustifyDistributedIndicates if the cells justified or distributed alignment should be used on the last line of text.
SetIsJustifyDistributedIndicates if the cells justified or distributed alignment should be used on the last line of text.
GetQuotePrefixIndicates whether the cell’s value starts with single quote mark.
SetQuotePrefixIndicates whether the cell’s value starts with single quote mark.
IsGradientIndicates whether the cell shading is a gradient pattern.
SetIsGradientIndicates whether the cell shading is a gradient pattern.
SetTwoColorGradientSets the specified fill to a two-color gradient.
GetTwoColorGradientSettingGet the two-color gradient setting.
IsPercentIndicates whether the number format is a percent format.
IsDateTimeIndicates whether the number format is a date format.
ToJsonConvert to JSON struct data.