Spread Windows Forms 6.0 Product Documentation
AddRange(ICollection) Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > NamedStyleCollection Class > AddRange Method : AddRange(ICollection) Method


c
NamedStyleCollection or array of NamedStyle objects to add to the collection

Glossary Item Box

Adds an array of styles (NamedStyle objects) to the collection.

Syntax

Visual Basic (Declaration) 
Public Overloads Overridable Sub AddRange( _
   ByVal c As ICollection _
) 
Visual Basic (Usage)Copy Code
Dim instance As NamedStyleCollection
Dim c As ICollection
 
instance.AddRange(c)
C# 
public virtual void AddRange( 
   ICollection c
)

Parameters

c
NamedStyleCollection or array of NamedStyle objects to add to the collection

Example

This example adds a range of styles.
C#Copy Code
FarPoint.Win.Spread.NamedStyle[] ns = {new FarPoint.Win.Spread.NamedStyle("Style1"),
new FarPoint.Win.Spread.NamedStyle("Style2"),
new FarPoint.Win.Spread.NamedStyle("Style3")}; 

FarPoint.Win.Spread.NamedStyleCollection nsc = new FarPoint.Win.Spread.NamedStyleCollection();

ns[0].Font = new Font("Comic Sans Serif", 12);
ns[0].Name = "StyleHeaders";
ns[0].Parent = "HeaderDefault";

nsc.AddRange(ns);

fpSpread1.NamedStyles = nsc;
fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = ns[0];
Visual BasicCopy Code
Dim ns As FarPoint.Win.Spread.NamedStyle() = {New FarPoint.Win.Spread.NamedStyle("Style1"), 
New FarPoint.Win.Spread.NamedStyle("Style2"), 
New FarPoint.Win.Spread.NamedStyle("Style3")}

Dim nsc As New FarPoint.Win.Spread.NamedStyleCollection

ns(0).Font = New Font("Comic Sans Serif", 12)
ns(0).Name = "StyleHeaders"
ns(0).Parent = "HeaderDefault"

nsc.AddRange(ns)

FpSpread1.NamedStyles = nsc
FpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = ns(0)

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.