[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Theme.-ctor

Theme Constructor

Theme(string, ITheme)

Initializes a new instance of the Theme class with the specified theme name and base theme.

Creates a custom theme by copying settings from the specified base ITheme. If baseTheme is null, the new theme is initialized from the Office theme.

The theme name must be unique and must not be empty or match a built-in theme name.

Declaration
public Theme(string themeName, ITheme baseTheme = null)
Public Sub New(themeName As String, Optional baseTheme As ITheme = Nothing)
Parameters
Type Name Description
string themeName

The name of the theme. Must not be null, empty, or the name of a built-in theme.

ITheme baseTheme

The base theme to initialize from. If null, the Office theme is used.

Examples
Theme theme = new Theme("CustomTheme", Themes.Berlin);
theme.ThemeColorScheme[ThemeColor.Accent1].RGB = Color.Blue;
workbook.Theme = theme;
Exceptions
Type Condition
ArgumentException

if themeName is null, empty, or matches a built-in theme name.