Spread Windows Forms 6.0 Product Documentation
DefaultStyleName Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : DefaultStyleName Property


Glossary Item Box

Gets or sets the name of the default style for the sheet.

Syntax

Visual Basic (Declaration) 
Public Property DefaultStyleName As String
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim value As String
 
instance.DefaultStyleName = value
 
value = instance.DefaultStyleName
C# 
public string DefaultStyleName {get; set;}

Property Value

String containing the name of the default style

Exceptions

ExceptionDescription
System.ArgumentException Specified NamedStyle object could not be found in the collection

Example

This example sets the background color and text color for the sheet based on the style information provided.
C#Copy Code
string s;
FarPoint.Win.Spread.NamedStyle parent = new FarPoint.Win.Spread.NamedStyle("Parent");
FarPoint.Win.Spread.StyleInfo si = new FarPoint.Win.Spread.StyleInfo();
si.BackColor = Color.Yellow;
FarPoint.Win.Spread.NamedStyle ns = new FarPoint.Win.Spread.NamedStyle("MyStyle", "Parent", si);
fpSpread1.ActiveSheet.DefaultStyle = ns;
fpSpread1.NamedStyles.Add(ns);
s = fpSpread1.ActiveSheet.DefaultStyleName;
label1.Text = "The name of the default style is " + s;
Visual BasicCopy Code
Dim s As String
Dim parent As New FarPoint.Win.Spread.NamedStyle("Parent")
Dim si As New FarPoint.Win.Spread.StyleInfo()
si.BackColor = Color.Yellow
Dim ns As New FarPoint.Win.Spread.NamedStyle("MyStyle", "Parent", si)
FpSpread1.ActiveSheet.DefaultStyle = ns
FpSpread1.NamedStyles.Add(ns)
s = FpSpread1.ActiveSheet.DefaultStyleName
Label1.Text = "The name of the default style is " & s

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.