NativeExcel for .Net Developer's Reference

IInterior.Pattern Property

Gets or sets the interior pattern.

[Visual Basic]
PropertyPatternAsXlPattern
[C#]
XlPatternPattern{get;set;}
[C++]
__propertyXlPatternget_Pattern();
__propertyvoidset_Pattern(XlPattern);
[JScript]
functiongetPattern():XlPattern
functionsetPattern(XlPattern);

Property Value

One of the XlPattern values.

Example

This example adds a crisscross pattern to the interior of cell A1 on worksheet one.

[C#]
book.Worksheets[1].Cells["A1"].Interior.Pattern = XlPattern.xlPatternCrissCross;
[VisualBasic]
book.Worksheets(1).Cells("A1").Interior.Pattern = XlPattern.xlPatternCrissCross
[C++]
book->Worksheets->Item[1].Cells->Item[S"A1"]->Interior->Pattern = XlPattern::xlPatternCrissCross;
This example deletes interior pattern from a range A1:C5.
[C#]
book.Worksheets[1].Range["A1:C5"].Interior.Pattern = XlPattern.xlPatternNone;
[VisualBasic]
book.Sheet(1).Range("A1:C5").Interior.Pattern = XlPattern.xlPatternNone
[C++]
book->Worksheets->Item[1]->Range->Item[S"A1:C5"]->Interior->Pattern = XlPattern::xlPatternNone;

See Also

IInterior Interface | NativeExcel Namespace | XlPattern Enumeration | Interior Property