Enum StyleModifyFlag

StyleModifyFlag enumeration

The style modified flags.

public enum StyleModifyFlag

Values

NameValueDescription
LeftBorder256Indicates whether left border has been modified for the style.
RightBorder512Indicates whether right border has been modified for the style.
TopBorder1024Indicates whether top border has been modified for the style.
BottomBorder2048Indicates whether bottom border has been modified for the style.
DiagonalDownBorder4096Indicates whether diagonal-down border has been modified for the style.
DiagonalUpBorder8192Indicates whether diagonal-up border has been modified for the style.
Diagonal12288Indicates whether one or more diagonal borders(DiagonalDownBorder, DiagonalUpBorder) have been modified for the style.
HorizontalBorder32Indicates whether horizontal border has been modified for the style. Only for dynamic style, such as conditional formatting.
VerticalBorder64Indicates whether vertical border has been modified for the style. Only for dynamic style, such as conditional formatting.
Borders16224Indicates whether one or more borders(LeftBorder, RightBorder, TopBorder, BottomBorder, Diagonal, HorizontalBorder, VerticalBorder) have been modified for the style.
NumberFormat16384Indicates whether numberformat has been modified.
HorizontalAlignment32768Indicates whether horizontal alignment has been modified.
VerticalAlignment65536Indicates whether vertical alignment has been modified.
Indent131072Indicates whether indent property has been modified.
Rotation262144Indicates whether rotation property has been modified.
WrapText524288Indicates whether wrap text property has been modified.
ShrinkToFit1048576Indicates whether shrink to fit property has been modified.
TextDirection2097152Indicates whether text direction property has been modified.
RelativeIndent128Indicates whether relative indent property has been modified for the style. Only for dynamic style, such as conditional formatting.
AlignmentSettings4161664Indicates whether one or more alignment-related properties(HorizontalAlignment, VerticalAlignment, Rotation, WrapText, WrapText, Indent, ShrinkToFit, TextDirection, RelativeIndent) have been modified.
Pattern4194304Indicates whether pattern of the shading has been modified.
ForegroundColor8388608Indicates whether foreground color has been modified.
BackgroundColor16777216Indicates whether background color has been modified.
CellShading29360128Indicates whether one or more shading-related properties(Pattern, ForegroundColor, BackgroundColor) have been modified.
Locked67108864Indicates whether locked property has been modified.
HideFormula134217728Indicates whether hide formula has been modified.
ProtectionSettings201326592Indicates whether one or more protection-related properties(Locked, HideFormula) have been modified.
FontSize1Indicates whether font size has been modified.
FontName2Indicates whether font name has been modified.
FontColor3Indicates whether font color has been modified.
FontWeight4Indicates whether font weight has been modified.
FontItalic5Indicates whether italic property of font has been modified.
FontUnderline6Indicates whether underline property of font has been modified.
FontStrike7Indicates whether strike property font has been modified.
FontScript8Indicates whether subscript or superscript property of font has been modified.
FontFamily9Indicates whether font family has been modified.
FontCharset10Indicates whether charset of the font has been modified.
FontScheme11unused.
FontDirty12unused.
FontSpellingError13unused.
FontUFillTx14unused.
FontSpacing15unused.
FontKerning16unused.
FontEqualize17unused.
FontCap18unused.
FontVerticalText19
Font31Indicates whether one or more properties have been modified for the font of the style.
All234881023Indicates whether one or more properties have been modified for the style.

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using System;

    public class StyleModifyFlagDemo
    {
        public static void StyleModifyFlagExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();

            // Add a new worksheet to the workbook
            Worksheet worksheet = workbook.Worksheets[0];

            // Set some values in the worksheet
            worksheet.Cells["A1"].PutValue("Sample Text");
            worksheet.Cells["A2"].PutValue(123.45);

            // Create a new style
            Style style = workbook.CreateStyle();
            style.Font.Name = "Arial";
            style.Font.Size = 12;
            style.Font.Color = System.Drawing.Color.Blue;
            style.HorizontalAlignment = TextAlignmentType.Center;
            style.VerticalAlignment = TextAlignmentType.Center;

            // Apply the style to a cell
            worksheet.Cells["A1"].SetStyle(style);

            // Check which style properties have been modified
            bool isFontModified = style.IsModified(StyleModifyFlag.Font);
            bool isFontSizeModified = style.IsModified(StyleModifyFlag.FontSize);
            bool isFontColorModified = style.IsModified(StyleModifyFlag.FontColor);
            bool isHorizontalAlignmentModified = style.IsModified(StyleModifyFlag.HorizontalAlignment);

            // Output the results
            Console.WriteLine("Font Modified: " + isFontModified);
            Console.WriteLine("Font Size Modified: " + isFontSizeModified);
            Console.WriteLine("Font Color Modified: " + isFontColorModified);
            Console.WriteLine("Horizontal Alignment Modified: " + isHorizontalAlignmentModified);

            // Save the workbook
            workbook.Save("StyleModifyFlagExample.xlsx");
        }
    }
}

See Also