Style

概述

Style 是 Aspose.Cells FOSS for C++ 中的一个类。

表示一个可变的单元格样式外观,可应用于一个或多个单元格。

此类提供了 46 个用于在 C++ 程序中处理 Style 对象的方法。可用的方法包括:Borders、Clone、Color、FillPattern、Font、FromCore、GetBackgroundColor、GetBorders、GetCustom、GetFont、GetForegroundColor、GetHorizontalAlignment,以及另外 33 个方法。安装 Aspose.Cells FOSS for C++ 包后,所有公共成员对任何 C++ 应用程序均可访问。访问器方法:Borders、Color、FillPattern、Font、HorizontalAlignmentType、VerticalAlignmentType。

访问器方法

名称类型访问描述
FontFont读取获取字体。
BordersBorders读取获取边框。
FillPatternFillPattern读取获取填充模式。
ColorColor读取获取颜色。
HorizontalAlignmentTypeHorizontalAlignmentType读取获取水平对齐类型。
VerticalAlignmentTypeVerticalAlignmentType读取获取垂直对齐类型。

方法

签名描述
Font() → Font获取字体设置。
Borders() → Borders获取边框设置。
FillPattern() → FillPattern获取填充模式。
Color() → Color获取填充前景颜色。
Color() → Color获取填充背景颜色。
HorizontalAlignmentType() → HorizontalAlignmentType获取水平对齐方式。
VerticalAlignmentType() → VerticalAlignmentType获取垂直对齐方式。
GetFont() → Font获取字体设置。
SetFont(value: Font)设置字体设置。
GetBorders() → Borders获取边框设置。
SetBorders(value: Borders)设置边框设置。
GetPattern() → FillPattern获取填充模式。
SetPattern(value: FillPattern)设置填充图案。
GetForegroundColor() → Color获取填充前景颜色。
SetForegroundColor(value: Color)设置填充前景色。
GetBackgroundColor() → Color获取填充背景颜色。
SetBackgroundColor(value: Color)设置填充背景颜色。
GetNumber() → int获取数值格式标识符。
SetNumber(value: int)设置数值格式标识符。
GetCustom() → std::string获取自定义数字格式代码。
SetCustom(value: std::string)设置自定义数字格式代码。
GetNumberFormat() → std::string获取已解析的数字格式字符串。
SetNumberFormat(value: std::string)设置数字格式。接受内置格式字符串或自定义格式代码。
GetHorizontalAlignment() → HorizontalAlignmentType获取水平对齐方式。
SetHorizontalAlignment(value: HorizontalAlignmentType)设置水平对齐方式。
GetVerticalAlignment() → VerticalAlignmentType获取垂直对齐方式。
SetVerticalAlignment(value: VerticalAlignmentType)设置垂直对齐方式。
GetWrapText() → bool获取单元格内文本是否换行。
SetWrapText(value: bool)设置文本是否在单元格内换行。
GetIndentLevel() → int获取缩进级别。
SetIndentLevel(value: int)设置缩进级别。必须在 0 到 250 之间。
GetTextRotation() → int获取文本旋转。
SetTextRotation(value: int)设置文本旋转。必须在 0 到 180 之间,或使用 255 表示垂直文本。
GetShrinkToFit() → bool获取单元格内容是否收缩以适应。
SetShrinkToFit(value: bool)设置单元格内容是否收缩以适应。
GetReadingOrder() → int获取阅读顺序。
SetReadingOrder(value: int)设置阅读顺序。必须为 0、1 或 2。
GetRelativeIndent() → int获取相对缩进。
SetRelativeIndent(value: int)设置相对缩进。
GetIsLocked() → bool获取工作表保护启用时单元格是否被锁定。
SetIsLocked(value: bool)设置工作表保护启用时单元格是否被锁定。
GetIsHidden() → bool获取在工作表保护启用时单元格公式是否隐藏。
SetIsHidden(value: bool)设置在工作表保护启用时单元格公式是否隐藏。
Clone() → Style创建当前样式的副本。已克隆的样式。
ToCore() → Core::StyleValue将此样式转换为核心 StyleValue。
FromCore(value: Core::StyleValue) → Style从 Core StyleValue 创建样式。

另请参阅

 中文