Spread Windows Forms 6.0 Product Documentation
NamedStyles Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > INamedStyleSupport Interface : NamedStyles Property


Glossary Item Box

Gets or sets the collection of styles used by the style model.

Syntax

Visual Basic (Declaration) 
Property NamedStyles As NamedStyleCollection
Visual Basic (Usage)Copy Code
Dim instance As INamedStyleSupport
Dim value As NamedStyleCollection
 
instance.NamedStyles = value
 
value = instance.NamedStyles
C# 
NamedStyleCollection NamedStyles {get; set;}

Property Value

NamedStyleCollection object containing the collection of styles

Example

This example returns the first style in the collection.
C#Copy Code
FarPoint.Win.Spread.Model.INamedStyleSupport ins;
FarPoint.Win.Spread.NamedStyleCollection nsc = new FarPoint.Win.Spread.NamedStyleCollection();
FarPoint.Win.Spread.NamedStyle ns1 = new FarPoint.Win.Spread.NamedStyle("StyleHeaders", "HeaderDefault");
FarPoint.Win.Spread.NamedStyle ns2 = new FarPoint.Win.Spread.NamedStyle("StyleData", "DataAreaDefault");
ns1.BackColor = Color.Yellow;
ns2.BackColor = Color.LightBlue;
fpSpread1.NamedStyles.Add(ns1);
fpSpread1.NamedStyles.Add(ns2);
ins = (FarPoint.Win.Spread.Model.INamedStyleSupport)fpSpread1.ActiveSheet.Models.Style;
ins.SetDirectAltRowName(0, "StyleHeaders");
ins.SetDirectName(1, 1, "StyleData");
nsc = ins.NamedStyles;
label1.Text = nsc[0].Name;
Visual BasicCopy Code
Dim ins As FarPoint.Win.Spread.Model.INamedStyleSupport
Dim nsc As New FarPoint.Win.Spread.NamedStyleCollection()
Dim ns1 As New FarPoint.Win.Spread.NamedStyle("StyleHeaders", "HeaderDefault")
Dim ns2 As New FarPoint.Win.Spread.NamedStyle("StyleData", "DataAreaDefault")
ns1.BackColor = Color.Yellow
ns2.BackColor = Color.LightBlue
FpSpread1.NamedStyles.Add(ns1)
FpSpread1.NamedStyles.Add(ns2)
ins = FpSpread1.ActiveSheet.Models.Style
ins.SetDirectAltRowName(0, "StyleHeaders")
ins.SetDirectName(1, 1, "StyleData")
nsc = ins.NamedStyles
Label1.Text = nsc(0).Name

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.