[]
Represents the border of an object.
An IBorder defines the formatting for a single border, including its
color, line style, theme color, and tint or shade. Instances are typically obtained
from an IBorders collection, such as the borders returned by
Borders or Borders.
public interface IBorder
Public Interface IBorder
IBorder border = worksheet.Range["A1"].Borders[BordersIndex.EdgeBottom];
border.LineStyle = BorderLineStyle.Dashed;
border.Color = Color.Blue;
| Name | Description |
|---|---|
| Color | Gets or sets the Color object assigned directly to this border. Use this property to read the border color set by this property, or to apply a fixed color to the border. If the border uses a theme color, use ThemeColor to read or set the theme-based color instead. |
| ColorIndex | Gets or sets the color index of this border. The value can be a palette color index or one of the special values defined by ColorDataIndex. None may be returned when reading the value, but setting None on a single IBorder does not change the border color. |
| LineStyle | Gets or sets the line style for the border. |
| ThemeColor | Gets or sets the ThemeColor value associated with this border. Use this property to read or apply a workbook theme color to the border instead of a fixed Color. If the border does not use a theme color, this property returns None. When the workbook theme changes, the displayed border color may change accordingly. |
| TintAndShade | Gets or sets the tint and shade value applied to the border color. The value ranges from -1 (darkest) to 1 (lightest), and 0 is neutral. The default value is 0. |
| Name | Description |
|---|---|
| Clear() | Clears the formatting of this border. Use this method to remove the current settings applied to a single IBorder, such as its line style and color. |