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


name
Name of the style to find

Glossary Item Box

Finds a style (NamedStyle object) in the collection with the specified name.

Syntax

Visual Basic (Declaration) 
Public Overridable Function Find( _
   ByVal name As String _
) As NamedStyle
Visual Basic (Usage)Copy Code
Dim instance As NamedStyleCollection
Dim name As String
Dim value As NamedStyle
 
value = instance.Find(name)
C# 
public virtual NamedStyle Find( 
   string name
)

Parameters

name
Name of the style to find

Return Value

NamedStyle object containing the style

Example

This example searches the collection for a named style with the specified name.
C#Copy Code
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");
FarPoint.Win.Spread.NamedStyle ns2 = new FarPoint.Win.Spread.NamedStyle();
ns1.BackColor = Color.LightBlue;
ns2.BackColor = Color.Gray;
nsc.AddRange(new Object[] {ns1, ns2});
fpSpread1.NamedStyles = nsc;
fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = nsc[0];
fpSpread1.ActiveSheet.DefaultStyle = nsc[1];
ns3 = nsc.Find("StyleData");
label1.Text = "There is a style in the collection with the name " + ns3.Name; 
Visual BasicCopy Code
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")
Dim ns3 As New FarPoint.Win.Spread.NamedStyle()
ns1.BackColor = Color.LightBlue
ns2.BackColor = Color.Gray
nsc.AddRange(New Object() {ns1, ns2})
FpSpread1.NamedStyles = nsc
FpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = nsc(0)
FpSpread1.ActiveSheet.DefaultStyle = nsc(1)
ns3 = nsc.Find("StyleData")
Label1.Text = "There is a style in the collection with the name " & ns3.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.