Visual Basic (Declaration) | |
---|---|
Public ReadOnly Property NamedStyles As NamedStyleCollection |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As FpSpread Dim value As NamedStyleCollection value = instance.NamedStyles |
C# | |
---|---|
public NamedStyleCollection NamedStyles {get;} |
Property Value
NamedStyleCollection containing the stylesBy default, this collection is shared between all sheets and style models in the component. When set, all style models that implement the INamedStyleSupport interface in the sheet are updated to reference the new collection.
This example creates two objects for the spreadsheet, a ColumnHeader and a NamedStyle. The NamedStyles background color is set to yellow, and is then applied to the ColumnHeader object, resulting in all the column headers having a background color of yellow.
C# | Copy Code |
---|---|
FarPoint.Web.Spread.ColumnHeadercolhdr;
FarPoint.Web.Spread.NamedStylemnstyle=newFarPoint.Web.Spread.NamedStyle();
mnstyle.Name="fpstyle";
mnstyle.BackColor=Color.Yellow;
FpSpread1.NamedStyles.Add(mnstyle);
colhdr=FpSpread1.ActiveSheetView.ColumnHeader;
colhdr.DefaultStyleName=mnstyle.Name; |
Visual Basic | Copy Code |
---|---|
DimcolhdrAsFarPoint.Web.Spread.ColumnHeader
DimmnstyleAsNewFarPoint.Web.Spread.NamedStyle()
mnstyle.Name="fpstyle"
mnstyle.BackColor=Color.Yellow
FpSpread1.NamedStyles.Add(mnstyle)
colhdr=FpSpread1.ActiveSheetView.ColumnHeader
colhdr.DefaultStyleName=mnstyle.Name |
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
Reference
FpSpread ClassFpSpread Members
NamedStyle Class
NamedStyleCollection Class