xlsgen > overview > Pattern

Fill Pattern options handle the background of cells. This option is probably the most used formatting style when it comes to underlines particular cells like totals and the like. Fill Pattern options are accessed by right-clicking on a cell and choosing Format Cell and then clicking on the Pattern tab. The most common pattern options are also provided in the formatting toolbar.



Fill Pattern options are part of the style object. See formatting and IXlsStyle for more information.

The programming interface for Fill Pattern options is IXlsPattern.

Fill Pattern options can be summed up by the following properties :

In order to produce the hashing pattern from the screen above, the following code is required :

VB code

Dim style As IXlsStyle
Set style = wksht.NewStyle

style.Pattern.BackgroundColor = &HFFFFBB
style.Pattern.ForegroundColor = &HFFBBFF
style.Pattern.Pattern = pattern_thindiagstripe
style.Apply

wksht.Number(4, 3) = 5

C# code

IXlsStyle style = wksht.NewStyle();

style.Pattern.BackgroundColor = 0xFFFFBB;
style.Pattern.ForegroundColor = 0xFFBBFF;
style.Pattern.Pattern = xlsgen.enumPattern.pattern_thindiagstripe;
style.Apply();

wksht.set_Number(4, 3, 5);

C/C++ code

xlsgen::IXlsStylePtr style = wksht->NewStyle();

style->Pattern->BackgroundColor = 0xFFFFBB;
style->Pattern->ForegroundColor = 0xFFBBFF;
style->Pattern->Pattern = xlsgen::pattern_thindiagstripe;
style->Apply();

wksht->Number[4][3] = 5;

 

xlsgen documentation. © ARsT Design all rights reserved.